Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Programmatic Click

Reply
Thread Tools

Programmatic Click

 
 
randy.buchholz
Guest
Posts: n/a
 
      01-08-2008
Am I missing something simple? I can't find a way to click a
button/linkbutton from my C# code. Specifically, I am trying to fire the
"New" button in a Details View to switch to insert mode.


 
Reply With Quote
 
 
 
 
AlBruAn
Guest
Posts: n/a
 
      01-08-2008
Use the following line, replacing Button1 with the name of your "New" button:

((IPostBackEventHandler)Button1).RaisePostBackEven t(null);

"randy.buchholz" wrote:

> Am I missing something simple? I can't find a way to click a
> button/linkbutton from my C# code. Specifically, I am trying to fire the
> "New" button in a Details View to switch to insert mode.
>
>
>

 
Reply With Quote
 
 
 
 
randy.buchholz
Guest
Posts: n/a
 
      01-08-2008
Cool! Thanks.

"AlBruAn" <(E-Mail Removed).(donotspam)> wrote in message
news:(E-Mail Removed)...
> Use the following line, replacing Button1 with the name of your "New"
> button:
>
> ((IPostBackEventHandler)Button1).RaisePostBackEven t(null);
>
> "randy.buchholz" wrote:
>
>> Am I missing something simple? I can't find a way to click a
>> button/linkbutton from my C# code. Specifically, I am trying to fire the
>> "New" button in a Details View to switch to insert mode.
>>
>>
>>



 
Reply With Quote
 
Phil H
Guest
Posts: n/a
 
      01-09-2008
On 8 Jan, 16:37, "randy.buchholz" <(E-Mail Removed)>
wrote:
> Am I missing something simple? *I can't find a way to click a
> button/linkbutton from my C# code. *Specifically, I am trying to fire the
> "New" button in a Details View to switch to insert mode.


What you are missing is the fact that the Click event is supposed to
be fired by the User on the client. If you want to put the DetailsView
control into Insert mode programmatically then just do this:

YourDetailsView.ChangeMode(DetailsViewMode.Insert)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
click click click Andy Morrison Computer Support 7 12-20-2007 06:50 AM
Programmatic production of HTML... Paul Mason ASP .Net 4 04-30-2004 02:59 PM
Datagrid Programmatic Hai Nguyen ASP .Net 3 01-17-2004 08:28 PM
Programmatic use of SetVaryByCustom DV ASP .Net 10 11-27-2003 10:19 AM
programmatic IISconfiguration via ASP.NET application Michael Porcelli ASP .Net 1 07-28-2003 03:39 AM



Advertisments