Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2010, 06:52 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default Issue with Dynamically created control Click_event

I have several records in my project that display in page_load event. Each record contains Dynamic button Control "submit" which has its own id created dynamically. Also has some linkbutton controls created (to display pages) in my page which is also Dynamic. I cant change that because that is how i wanted for my project.

Now the issue is:

public void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindData(1,5);//i want this to happen only here and not in the else statement, but thats the issue.

}
else
{

BindData(1, 5); //if i dont disable this, submit is working but linkbutton gives me the error "Muttiple control have same submit button id".
if i disable it, link is working, but submit is not firing its event.

//when i click the linkbutton(which is postback and pager controls eg: 1,2,3,4..) , i dont want this binding to happen, coz i already have the Binding inside its event handling function based on which link button is created. But if i disable this BindData, and while i click the "Submit" button which i have in each record, the event is not firing, because the controls are not created in page_load i guess.
}
}

So i want to check in the else statement in the page_load, whether the Dynamic link buttons are clicked? is there way to check the Dynamic buttons?
-Thanks for your time.
 
Old June 17th, 2010, 02:29 PM
Registered User
 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom Server Controls

one way is to build a custom server control.

see this blog...

donateknowledge.blogspot.com


other way is writing an event urself.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with Dynamically created control Click_event Gayathri79 ASP.NET 3.5 Basics 2 May 19th, 2010 12:32 AM
Accessing dynamically created content in a literal control ericburnley C# 2005 4 March 4th, 2010 05:09 PM
Please help me about dynamically created controls vingo_mail ASP.NET 2.0 Basics 1 March 24th, 2008 12:54 PM
Saving Data to DB in dynamically created control ashokkumar ASP.NET 1.0 and 1.1 Basics 2 June 23rd, 2006 01:18 PM
Dynamically created controls katsarosj ASP.NET 1.0 and 1.1 Basics 4 February 4th, 2004 09:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.