CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: how to pass interger value as...

  1. #1
    Join Date
    Jul 2006
    Posts
    38

    how to pass interger value as...

    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.

  2. #2
    Join Date
    Jul 2001
    Location
    Otaki, New Zealand
    Posts
    303

    Re: how to pass interger value as...

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)