.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to disable the Prev or Next button on a pager template when there is no data

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

I have a pager template in a formview which shows the Prev, Next button and the number of pages. I want to make the Prev or the Next button disable when there are no more pages to go. Like, if it is the first page, then the Prev button will be disabled. 

<PagerSettings Mode="NextPreviousFirstLast" />

<PagerTemplate> <table align="

View Complete Post

More Related Resource Links

I need to be able to disable a button inside a repeater control when an item in the data is <1

For example, I have an inventory table. If any one of the items is less then one, I need to disable the button. <asp:Repeater id="repeater1" <ItemTemplate> <asp:Button id=btnSize /> </ItemTemplate> </asp:Repeater>  

disable a button if the required page has no data


Hi all

I have the following scenario and I'm not sure how to go about in resolving it.  Any ideas would gratefully recieved.

I have a page(A) with a button that when selected opens a new page(B) with a populated gridView.

However if the gridview hasn't got any data to display, rather than use the  <EmptyDataTemplate> within the gridview, I'd rather use disable/lock the button on page(A) thus preventing access to page(B)

Is this possible?  How on earth would I go about such a task ?

Merge SQL to Excel--Need .Net button to open on fly and have current SQL data!


           Hello all,
I do not know if this is the proper place to ask this, but my question is...
I have a SQL DB and I want to convert it to Excel Sheet (I did this using the wizard)!
In my aspx page I have a button.  So when I press this button I want the Excel sheet to open!  But I need the Excel sheet to show me the up to date information that is in the SQL DB.  

Collaboration Data Objects: Send Microsoft Exchange Appointment Reminders to Your Pager Using CDO


Besides your typical e-mail services, Microsoft Exchange also provides the service infrastructure you need to build extensible knowledge and workflow management systems. Understanding Collaboration Data Objects (CDO) is the key to accessing these Exchange services for your own programs. With CDO you can automate tedious tasks and integrate information such as e-mail, calendars, and contacts with almost any application. This article explains how CDO enables you to access Exchange services, then walks you through a sample application that reads calendar events from an Exchange server and sends pager reminders to your users.

Sean McCormick

MSDN Magazine June 2000

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

System.Data.SqlClient.SqlException: Login failed for user . Reason: The account is disable


Hi All,

Thank you for advance.

I created a widows service for mail schedule with c#.net and sql server 2005 and it is working fine for past one year.

now sometimes i am getting the "System.Data.SqlClient.SqlException: Login failed for user '<UserName>'. Reason: The account is disabled." error.

then i restarted the windows service manually and working.

what is the problem in my sql server connection and how to fix that issue?

Get the controls from a TabItem's data template

Hello, I am using the following Style on a custom TabItem that I am using: <Style TargetType="{x:Type local:GSFTabItem}"> <Style.Resources> <cmn:EnumDisplayConverter x:Key="Converter" Type="{x:Type crys:GSFOperator}"/> <local:GSFTabVisibilityConverter x:Key="visibility"/> </Style.Resources> <Setter Property="DataContext" Value="{DynamicResource GSFObject}"></Setter> <Setter Property="Header" Value="{Binding Field}"/> <Setter Property="Content" Value="{DynamicResource GSFObject}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:GSFTabItem}"> <Grid> <Border Name="Border" BorderBrush="Black" BorderThickness=".5,.5,.5,0" Background="White" > <StackPanel Orientation="Horizontal"> <Label VerticalAlignment="Center" HorizontalAlignment="Center" Content="{Binding Field}"/> <Label Content="X" IsHitTestVisible="True"

Getting the data's next record, by clicking a button

Hi sorry if asked this twice, please help me understand how to get the next or before record from the database as from the below code i am only getting one record up, and please provide with code as i understand it better that way not that i am in a rush or anything.... thankyou.. please take a look at the code below private void button1_Click(object sender, RoutedEventArgs e) { NorthwindLINQDataContext mycontext = new NorthwindLINQDataContext(); var myquery = from myrow in mycontext.Orders select new { CID = myrow.CustomerID, EmpId = myrow.EmployeeID, OID = myrow.OrderID }; //This will retrieve all records from the db foreach (var valuesFromQuery in myquery) { textBox1.Text = valuesFromQuery.CID; textBox2.Text = valuesFromQuery.EmpId.ToString(); textBox3.Text = valuesFromQuery.OID.ToString(); } } private void NEXT_Click(object sender, RoutedEventArgs e) { NorthwindLINQDataContext mycontext = new NorthwindLINQDataContext(); } private void BEFORE_Click(object sender, RoutedEventArgs e) { NorthwindLINQDataContext mycontext = new NorthwindLINQDataContext(); } } D.Boy

listview with button in item template - how do I handle the click event?

Hello,Using a listview control for the first time... I need a button for each item, and of course I need to handle the click event for the buttons... upon clicking a particular button I of course need to know which item the button is associated with so the appropriate action can be taken...In VS, I can't select the button and see my list of available events in the properties window like is normally done for controls outside of templates like this... what do I need to do?

Disable/hide minimize button

Does anyone know if you can disable or hide just the minimize button on a window? What I want is a resizable window which also has a maximize but not a minimize button. Thanks

How to cancel(disable) combobox in the time is under pressure button?

Hi I have one button and one combobox. How to do so that in time I press the button the combobox turn on be gray or freez. thanks 

disable postback on a button

Hey guys, I'm pretty new to asp.net and having some troubles.   I have a button whose sole purpose is to set  div.visible = true There is a calendar control on my page and I need the selected date to remain selected after I hit this button. Right now if I hit the button it refreshes the whole page and sets the calendar's selected day back to date. today   Any ideas?  

Use Data in a Column as Select Button in GridView

I don't want to use the built in "Select" hyperlink that's in the gridview, I'd like to just use the first data column, is there a way to do that or are we forced to use the automatically generated "Select" column.Thanks!

Enable Disable Save Button in Winforms App

Hi, In our windows forms application we have many forms with "Save" buttons. We want to enable them only if the data in the form is changed. At the moment it is handed by adding flags to check whether the data is dirty. Is there any easy way to handle this? May be something with the famework? Thanks,CJ

How to create some button template using WPF ?

Hi, I want to create some button template using WPF - The template will contain special button with the look and feel and special event that i need to my application. I don't understand if the i need to do it as ResourceDictionary or as user control and what is the different between them. And i also don't understand how can i add event to the ResourceDictionary ? Thanks for any help.

How to conditionally Enable/Disable Button control using JavaScript ?

hi all... i have a Button control & a TextBox control on my web page. The Button control is initially Disabled. I want that while typing into TextBox, when the length of the contents of TextBox reaches to 12 (i.e. when i type 12th character), the Button Control should be Enabled & if the length again comes down to less than 12, the Button control should again be Disabled... How can i do this using JavaScript...?? Does anyone know how to do this...?? Please help. It's urgent... Thanx in advance to all posts !
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend