.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

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

Posted By:      Posted Date: September 05, 2010    Points: 0   Category :ASP.Net
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>  

View Complete Post

More Related Resource Links

Dynamically (on client side) populating data control (repeater) when dropdown item is selected

Hello!I'm currently working on a project and I want to make as much things as possible performing on client side - with as little loading as possible.The project consist of three "main" pages. On one page I use jQuery DataTable plugin which is working great. One page has tabs (using jQuery). I want to put datacontrol (repeater) on this site and when  user selects one item in dropdown, data in repeater loads on client side, without performing the action on server.I wonder if this is possible and if somebody can give me some case to help with?Thanks!I hope I was clear enough. all the best

Does the ReportViewer control print button work inside of a modal MSIE window?

I am getting the following two error messages when using the new ReportViewer v10 control after pressing the toolbar print button. I am only seeing this error inside of a modal popup window in MSIE. The print button in a normal popup window doesn't have this error. An error occurred trying to get the current window Error: Could not complete the operation due to error 8007f305. If anyone knows of a quick fix, please let me know. Thank you. VS2010, MSIE 8, SQL Server 2008.

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 !

Get non data item to the Gridview ItemTemplate Button

Can somebody suggest how to get the variable value to the hyperlink postbackurlHere the code that i have in Gridview<asp:TemplateField HeaderText="Process" ShowHeader="False">            <ItemTemplate>               <asp:Button ID="Button1" CssClass="btn" PostBackUrl='<%# String.Format("http://googlemaps.com?ID={0}&Name={1}&Address={2}", Eval("No"), Label2.text, Eval("Id"))%>'                runat="server" Text="Process" OnClick="LinkButton1_Click"   />             </ItemTemplate>            </asp:TemplateField>I have ID and Address parameter coming from the dataset/Datasource but not the Name parameter.Is there a way that I can pass the non databound item to the postBackUrl query string.

Fetch the value of a control inside the 3rd repeater.


There is one repeater inside that there is one more reapeater and inside that there is third repeater and in third repeater there is one Label control, which is generatiing dynamically. I have to fetch the value of each label controls. Thanks.

button inside repeater onclick VB.net


I am trying to call a function when the button is clicked, but the button is inside a repeater. The functions are also called when the page loads because I need to load the values. I am getting this error:

BC30408: Method 'Public Sub getProductSize()' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. 

HELP ! - how to disable spesific control inside the grid view



I need to disable the "Imagebuttons" after the user click on one of them... I've sucessfully updated the table when the user click on a button using the following code on the event of row command of the gridview...


if (e.CommandName == "voter_up")
            SqlCommand voteup = new SqlCommand("update arto_comments set voteup = voteup+1 where cid=" + e.CommandArgument, con);
            SqlCommand getVup = new SqlCommand("select voteup from arto_comments where cid =" + e.CommandArgument, con);
            //lblvoteup.Text = Convert.ToString(getVup.ExecuteScalar());
            //GridView1.Rows[1].FindControl("ImageButton1"). = false;
            ImageButton1.Enabled = false;

so please how may I disable these buttons after database is updated ?

Thanx and Regards

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


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="

asp:button Click event (inside a repeater) lost on postback.


 I have been writing C# code for about 3 years now and have never had this happen.

I am using an asp:repeater (inside an update panel):

<asp:Repeater runat="server" ID="rptRedFolderDocs" OnItemDataBound="rptDataBound">

inside the repeater I have a button with a click event with server side code.

When the page loads, the repeater is databound to a datatable popuplated from SQL connection.  The repeater is NOT bound on postback. I wanted the data to persist.

When the button is click

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 ?

Getting data from table. Repeater control?


I'm trying to trying to create a tabe which can be resized by the user by entering the number of rows and columns in textboxes. The user should also be able to change the background color of the individual cells by clicking on them. I have figured out the code for this.

I did first try to create this table dynamically, but then I couldn't persist the changes to the table between postbascks, and I couldn't get any data from the cells when I wanted to save the table. Therefore I'm thinking of creating a repeater instead. If so, how could I specify how many times the repeater should repeat?.

I don't have a complete representation of the table in any database, I just store the exceptions and the number of rows and columns.

If anyone have a better solution to have I can do this, please share. 

Changing data item value Repeater dynamically


How do i dynamically change the value of dataitem in repeater control(.net 2.0,VS 2005)..i have repeater something like this :
<asp:Repeater ID="rptGameInfo" runat=server OnItemDataBound="itemDataBound_rptGameInfo"  >
<HeaderTemplate >

<ItemTemplate >
<asp:Label ID="lblLoc" runat=server Text="Location:" ></asp:Label><%# Eval("GAME_LOCATION")%><br />
</ItemTemplate >

and it shows the result like this:

If location is "Select" i want to change it to "n/a". So i am trying to capture it in itemDataBound even something like this

if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
                DataRowView row = e.Item.DataItem as DataRowView;
                string location = row["GAME_LOCATION"].ToString();

                if (location == "Select"

How to access the data item(current row) in the field template control?



     How to access the data item(current row) in the field template control? 

Checkbox inside a repeater control.



I have a checkbox in a repeater control.

I just want to check only one check box.

How to do this.

Button event inside TabContainer ajax control not firing


I'm a little stumped, I can't get the event from a button to fire inside a TabContainer control. I have a TabContainer that is built dynamically based on a dataset. Then inside the TabPanels I had a dynamic user control (which is an HTML table with a text box and button on). See code:

Guid gu = System.Guid.NewGuid();                           

UsrCtrlQuestionBlock ucqb = (UsrCtrlQuestionBlock)LoadControl("~/Questionnaire/UsrCtrlQuestionBlock.ascx");                                                       ucqb.ID = "table_" + gu.ToString();                           

ucqb.Question = questions[i].QuestionText;                           

ucqb.Response = questions[i].Response;                           

ucqb.Audited = questions[i].Audited;                           

ucqb.Covered = questions[i].ReqCovered;              &nbs

How to display data in asp.net Repeater control?

In this article, we will see how to display the data using repeater control which is basic and light weight control in asp.net

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.
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