LinkButtons...please help..

Discussion in 'ASP .Net' started by =?Utf-8?B?SXJmYW4gQWtyYW0=?=, Feb 15, 2005.

  1. Hi Guys,

    How different is a linkbutton control from a Button control. I have written
    the followiiing code on click of a link button control, but it doesnt seem to
    respond to that code, i.e nothing happens.

    Please help..

    Thanks,

    I.A

    //Check which user is logged in
    OdbcConnection myCon = new CommonUtilities().CreateOdbcConnection();
    myCon.Open();

    string getUserType = "SELECT role from account_details ";
    getUserType += "WHERE username = '" + Session["UserLogged"] + "'";

    OdbcDataReader result = new
    CommonUtilities().selectStatement(myCon,getUserType);

    result.Read();

    switch (result.GetChar(0))
    {
    case 'A':
    Response.Redirect("AdminScreen.aspx",false);
    break;

    case 'T':
    Response.Redirect("TeamLeaderScreen.aspx",false);
    break;

    case 'E':
    Response.Redirect("ExaminerScreen.aspx",false);
    break;

    }

    result.Close();
    myCon.Close();
    =?Utf-8?B?SXJmYW4gQWtyYW0=?=, Feb 15, 2005
    #1
    1. Advertising

  2. You are not including what section in your code file is this code located. Is
    it in the linkbutton click event handler?

    "Irfan Akram" wrote:

    > Hi Guys,
    >
    > How different is a linkbutton control from a Button control. I have written
    > the followiiing code on click of a link button control, but it doesnt seem to
    > respond to that code, i.e nothing happens.
    >
    > Please help..
    >
    > Thanks,
    >
    > I.A
    >
    > //Check which user is logged in
    > OdbcConnection myCon = new CommonUtilities().CreateOdbcConnection();
    > myCon.Open();
    >
    > string getUserType = "SELECT role from account_details ";
    > getUserType += "WHERE username = '" + Session["UserLogged"] + "'";
    >
    > OdbcDataReader result = new
    > CommonUtilities().selectStatement(myCon,getUserType);
    >
    > result.Read();
    >
    > switch (result.GetChar(0))
    > {
    > case 'A':
    > Response.Redirect("AdminScreen.aspx",false);
    > break;
    >
    > case 'T':
    > Response.Redirect("TeamLeaderScreen.aspx",false);
    > break;
    >
    > case 'E':
    > Response.Redirect("ExaminerScreen.aspx",false);
    > break;
    >
    > }
    >
    > result.Close();
    > myCon.Close();
    >
    >
    >
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=, Feb 15, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vidar Petursson

    Re: LinkButtons and MouseOver

    Vidar Petursson, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,235
    sramruttun
    Jul 9, 2003
  2. Rick Glos
    Replies:
    0
    Views:
    637
    Rick Glos
    Jul 8, 2003
  3. Lucas Tam

    LoadPostData and LinkButtons

    Lucas Tam, Aug 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    313
    Lucas Tam
    Aug 18, 2003
  4. Stefan Landgraf

    Linkbuttons not working

    Stefan Landgraf, Dec 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    322
    Stefan Landgraf
    Dec 11, 2003
  5. KK
    Replies:
    2
    Views:
    528
    Big Brian
    Oct 14, 2003
Loading...

Share This Page