Click to See Complete Forum and Search --> : how to pass interger value as...


bhuraasif
May 26th, 2007, 11:07 AM
hi everyone


I want to pass integer value as width of table.

the code given below is working fine,but i dont know how to put this value in HTML table coe. i tried but it doesnt work

GetYes(Convert.ToInt32(lblyes.Text),Convert.ToInt32(lbltotal.Text));


private int GetYes(int opt, int tot)
{

int i = 100;
per = (i * opt) / tot;
lblyes.Text = per.ToString();
yerper.Text = lblyes.Text+ "%";
return per;

}

now i want to display the per variable to HTML CODE
like i tried

<table bgcolor="blue" id="tbtotal" width='<%=Request.QueryString["per"]%>%'height="20">

this is not working

even i tried like


public int RetPer()
{
return per;
}


<table bgcolor="blue" id="tbtotal" width='<%# RetPer %>%'height="20">


Please help me out

Waiting for reply.

AlanGRutter
May 27th, 2007, 10:31 PM
Is your code running server side or client side?
ASP.NET 2.0 ?

I'm not very familiar with this stuff but on client-side don't you just need to get the element by id (getElementById) and then set the width to what you want.

If server side can't you just reference tbtotal.Width in the same way as you reference lblyes.Text

Regards
Alan