Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:674294
More Search Options
RSS Available
Matching Posts
Re: Which button caused the post back.
Lee Dumond: Sorry to butt in... but seems to me is would be just as easy to check the postback data. Remember, even if multiple buttons can postback, only the one that actually caused it will be contained in the postback. References to the other button(s) will be null. Say, in the case of two buttons: If Page.IsPostBack Then If Request.Form( "Button1" ) IsNot Nothing Then Response.Write( "This was a postback from Button 1" ) Else Response.Write( "This was a postback from Button 2" ) End If End If
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 11/5/2006
Re: Which button caused the post back.
A correction (based on the previous post): The last test should be comparing the __EVENTARGET against theControl.ClientID, not theControl.ID. When I tested this it worked because it was a simple page (with no INamingContainer controls) so the ClientID and ID were the same.
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 11/4/2006
Re: Which button caused the post back.
I guess I was hoping for something simpler, like a property on the Page that tells which control caused the post back or a property on the Control that tells whether or not the control caused a post back, but I guess not. I created this method that takes a control and returns true if that control caused the postback. I believe I covered all the possibilities, but if anything's missing feel free to let me know.... private bool CausedPostBack(Control theControl) { if (theControl.GetType().Equals(typeof
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 11/4/2006
Re: Which button caused the post back.
It's been a while since you posted this question, but if you're still trying to figure this out... If I was doing something like that I would move the creating of dynamic controls to Page_PreRender which occurs after all the controls' change and postback events. This way, you can create your controls dynamically after the button click events have fired. If that can't be done, my next thought would be to re-create the controls after handling the remove button's event (as a last resort, as that is
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 11/3/2006
Re: WebControl Collection properties that can be set declaratively
I found the information I was looking for on MSDN and I thought I'd post it here in, hoping that it may be useful to someone else. There is an attribute called ParseChildrenAttribute which can be applied to a class. This attribute specified which property in the Control is a collection to which nested asp.net tags should be added. Any nested tags that are not the correct type will cause an exception to be thrown. The page that I found most helpful was: http://msdn.microsoft.com/library/default
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 10/31/2006
Re: WebControl Collection properties that can be set declaratively
Well, no I don't want to create a list control... but I do want to create a control that has a collection of items that can be set in the markup just like the list controls. It iss actually a validator type of control that I'm working on.
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 10/31/2006
WebControl Collection properties that can be set declaratively
I have a question, but I'm not sure how to put it. I think an example would help: DropDownList defines a property called Items which is a ListItemCollection. These can of course be set in the code-behind (using the Items property of the DropDownList). What I am interested in is the fact that they can be set in the markup as: <asp:DropDownList ...> <asp:ListItem Text="..." Value="..." /> <asp:ListItem Text="..." Value="..." /> </asp
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 10/30/2006
Re: How can I get the row information I'm on?
Could the problem be that you don't have a selected row (it is an edit row not a selected row)? It's hard to tell for sure without seeing all of the code, but here's something I have done in similar situations - bind the CommandArgument of the button (in the EditItemTemplate) to the value that you want. For instance, if the key field in the databse is empid, you would use CommandArgument='<%# Eval("empid") %>' Then in the button click event you can retrieve it
Posted to
Data Presentation Controls
(Forum)
by
aspnetprogrammer
on 10/17/2006
Re: custom validator class
Thanks for the comments. I'll keep looking into this. Side note: I took a look at your validation controls. I think you addressed every limitation I wanted to see fixed and did quite a bit more (the main things I was looking at changing is having multiple validation groups and being able to customize what happens on an error). Very nice.
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 10/17/2006
custom validator class
I am trying to create my own validator class because the built in validators lack certain functionality I want (and partly as a learning exercise). I know there is BaseValidator class as well as an interface called IValidator and am wondering if it is better to inherit from BaseValidator or to implement IValidator. Also, I have been searching on the Internet (including this forum) a little had so far have not found much. Does anyone know of an article or website or something that details how to do
Posted to
Web Forms
(Forum)
by
aspnetprogrammer
on 10/9/2006
Page 1 of 2 (17 items) 1
2
Next >
Channel 9:
Fishbowl for Facebook
WindowsClient:
Free Embeddable Fonts for your WPF Applications
ASP.NET:
Program Manager Position on the ASP.NET PM team
Channel 10:
Microsoft Teams Up with Nielsen
Channel 10:
What Azure Looks Like
ASP.NET:
Orchard team looking for a new developer
Channel 10:
Student Discount on Office 2008 for Mac Now Available
WindowsClient:
Surface SDK 1.0 SP1 supports XNA Game Studio 3.0 and later
WindowsClient:
TestAPI 0.4 Released
Channel 9:
Using the SharePoint Business Data Connectivity Designer in VS 2010
Channel 9:
10-4 Episode 36: Windows Server AppFabric and Workflow Services Lab
WindowsClient:
New WPF Features: DatePicker\Calendar\VSM\Datagrid
Channel 9:
Corrinne Yu: Principal Engine Architect, Halo Team Microsoft
TechNet Edge:
IT Pro Momentum y Evidencias
Channel 10:
Xbox Goes Social with Facebook, Twitter, and Zune Integration
ASP.NET:
Enabling the ASP.NET Ajax script loader for your own scripts
ASP.NET:
Building High Performance Web Applications
WindowsClient:
RIA Services: A DomainService IS A WCF Service – Add Service Reference
Silverlight:
LIDNUG: Online chat with me Monday Nov 23rd
ASP.NET:
Recent Podcasts
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online