[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Saman Priyantha

2/10/2004 5:49:00 AM

I add a button to my webForm in aspx and I use c# language using Visual
Studio. Then I use Server.Transfer method to call another web page in the
button_click method. When I assign a value for a hidden field in a
button_click mehod , Calling web Page doesn't include the value of hidden
field. Please tell me how I solve this problem.
code of first web page button_click method
private void Button1_Click(object sender, System.EventArgs e)

{

CheckBox tcTo;

CheckBox tcCc;

CheckBox tcBcc;

foreach(DataGridItem DemoGridItem in DataGrid1.Items)

{

tcTo =(CheckBox)DemoGridItem.Cells[0].Controls[1];

tcCc =(CheckBox)DemoGridItem.Cells[1].Controls[1];

tcBcc =(CheckBox)DemoGridItem.Cells[2].Controls[1];


if(tcTo.Checked==true)

{

tcstrGetCheckTo+=(string)DemoGridItem.Cells[3].Text+";";


}

if(tcCc.Checked==true)

{

tcstrGetCheckCc+=(string)DemoGridItem.Cells[3].Text+";";


}

if(tcBcc.Checked==true)

{

tcstrGetCheckBcc+=(string)DemoGridItem.Cells[3].Text+";";


}


}

HidTo.Value=tcstrGetCheckTo;

HidCc.Value=tcstrGetCheckCc;

HidBcc.Value=tcstrGetCheckBcc;


Server.Transfer("WebForm1.aspx");

}

smanpre@yahoo.com


2 Answers

CMA

2/10/2004 6:47:00 AM

0

hi dear, :))

if u need to refer any value from one page to another page, u can use
"Session" variables. pls check on Session variables.

you can use Response.Redirect("URL"); to navigate to a new page too.

regards,
CMA.


"Saman Priyantha" <smanpre@yahoo.com> wrote in message
news:u5kMFm57DHA.2116@TK2MSFTNGP10.phx.gbl...
> I add a button to my webForm in aspx and I use c# language using Visual
> Studio. Then I use Server.Transfer method to call another web page in the
> button_click method. When I assign a value for a hidden field in a
> button_click mehod , Calling web Page doesn't include the value of hidden
> field. Please tell me how I solve this problem.
> code of first web page button_click method
> private void Button1_Click(object sender, System.EventArgs e)
>
> {
>
> CheckBox tcTo;
>
> CheckBox tcCc;
>
> CheckBox tcBcc;
>
> foreach(DataGridItem DemoGridItem in DataGrid1.Items)
>
> {
>
> tcTo =(CheckBox)DemoGridItem.Cells[0].Controls[1];
>
> tcCc =(CheckBox)DemoGridItem.Cells[1].Controls[1];
>
> tcBcc =(CheckBox)DemoGridItem.Cells[2].Controls[1];
>
>
> if(tcTo.Checked==true)
>
> {
>
> tcstrGetCheckTo+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
> if(tcCc.Checked==true)
>
> {
>
> tcstrGetCheckCc+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
> if(tcBcc.Checked==true)
>
> {
>
> tcstrGetCheckBcc+=(string)DemoGridItem.Cells[3].Text+";";
>
>
> }
>
>
> }
>
> HidTo.Value=tcstrGetCheckTo;
>
> HidCc.Value=tcstrGetCheckCc;
>
> HidBcc.Value=tcstrGetCheckBcc;
>
>
> Server.Transfer("WebForm1.aspx");
>
> }
>
> smanpre@yahoo.com
>
>


Saman Priyantha

2/10/2004 9:10:00 AM

0





*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!