You get the SubmitControl ID in the Request.form
Collection - if you have two usercontrols with ids UC1
and UC2 and in both there is a button PbSubmit, and you
press PbSubmit in Uc2, request.form["UC2:PbSubm it"]
exists and
request.form["UC1:PbSubm it"] doesn`t exists. So you could
write in PageLoad:
if (!IsPostback)
{
if (request.form["UC2:PbSubm it"]!=null)
{ Uc2 submitted}
if (request.form["UC1:PbSubm it"]!=null)
{ Uc1 submitted}
}
[color=blue]
>-----Original Message-----
>If I have one page aspx that is using two same user[/color]
control, how can I know[color=blue]
>in page load event of aspx that which id of user control[/color]
is submit ?[color=blue]
>
>
>.
>[/color]
Almost done.
But below routine is for checking there is user control in form or not but I
need to check that which submit button is pressed from user control.
"mike" <docmike@gmx.at > wrote in message
news:019101c34b b3$700aefe0$a10 1280a@phx.gbl.. .[color=blue]
> You get the SubmitControl ID in the Request.form
> Collection - if you have two usercontrols with ids UC1
> and UC2 and in both there is a button PbSubmit, and you
> press PbSubmit in Uc2, request.form["UC2:PbSubm it"]
> exists and
> request.form["UC1:PbSubm it"] doesn`t exists. So you could
> write in PageLoad:
>
> if (!IsPostback)
> {
> if (request.form["UC2:PbSubm it"]!=null)
> { Uc2 submitted}
> if (request.form["UC1:PbSubm it"]!=null)
> { Uc1 submitted}
> }[/color]
Comment