LinkButtons and PostBacks

N

narmathabala

Hi,

I have a set of linkbuttons postback to the same page using
Response.Redirect().
It works great with FF but not on IE (surprising). On IE, the PostBack
does not work. Am I missing anything here? I work with .Net 2.0.
Could anyone please, let me know how to work around this?

Page_Load()
{
if(!isPostBack)
{
if(Request.Querystring["action"] == "click1")
DoClick1();
if(Request.Querystring["action"] == "click2")
DoClick2();
}
}
LinkButton1_Click()
{
Response.Redirect("main.aspx?action=click1");
}

LinkButton2_Click()
{
Response.Redirect("main.aspx?action=click2");
}

Thanks in advance,
Narmatha
 
M

Mark Rae

It works great with FF but not on IE (surprising).

What does that mean, exactly...?
On IE, the PostBack does not work.

In what way does it "not work" - when you step through the code, what is the
difference in IE and FireFox...?
 
N

narmathabala

Hi Mark,

When I step thro the code, the LinkButton1_Click() and
LinkButton2_Click() works.
When I deploy this on the server, the LinkButton postbacks dont seem to
work in IE. It does work in FireFox.
Please check this link in FF and IE 6, you will notice the difference
http://rapid.bdiamond.biz/home/test.aspx

This is the code snippet
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["action"] == "click1")
MultiView1.ActiveViewIndex = 0;
if (Request.QueryString["action"] == "click2")
MultiView1.ActiveViewIndex = 1;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("~/home/test.aspx?action=click1");
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("~/home/test.aspx?action=click2");
}

Thanks,
Narmatha
 
N

narmathabala

Beats me!
Does not work for me. It could be of great help if you could throw more
light on this behavior.
Is it something about the IE setting?
 
M

Mark Rae

Beats me!
Does not work for me. It could be of great help if you could throw more
light on this behavior.
Is it something about the IE setting?

Well, the only thing I can think of that might explain it would be if you
had disabled JavaScript for some reason...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top