J
Josh Nikle
I have a webform containing a GridView control "GridView1" and
usercontrol which is also a GridView "GridView2." I have a button
column in the usercontrol. The code behind that button adds an entry
to my database, which it's doing fine, but I can't get GridView1 to
show the updated data unless I browse to another page and then come
back.
I've been reading about using java script to accomplish this, but I
must be doing something wrong. I don't get any errors, GridView2 just
gets updated and GridView1 doesn't change. I've also noticed that
clicking refresh doesn't update GridView1 either, so maybe the java
script isn't the answer?
I'm very new to C#/ASP.NET, so could someone provide a sample of where
to put the script? The usercontrol (which is where I believe the
script needs to go?) uses a PreRender event rather than a PageLoad
event, if that makes any difference. Perhaps that's the issue? I've
read the numerous posts on the subject here and have been to pretty
much every blog that comes up in my browser, but no luck. I'm sure
it's something simple.
Any help is greatly appreciated.
-Josh Nikle
usercontrol which is also a GridView "GridView2." I have a button
column in the usercontrol. The code behind that button adds an entry
to my database, which it's doing fine, but I can't get GridView1 to
show the updated data unless I browse to another page and then come
back.
I've been reading about using java script to accomplish this, but I
must be doing something wrong. I don't get any errors, GridView2 just
gets updated and GridView1 doesn't change. I've also noticed that
clicking refresh doesn't update GridView1 either, so maybe the java
script isn't the answer?
I'm very new to C#/ASP.NET, so could someone provide a sample of where
to put the script? The usercontrol (which is where I believe the
script needs to go?) uses a PreRender event rather than a PageLoad
event, if that makes any difference. Perhaps that's the issue? I've
read the numerous posts on the subject here and have been to pretty
much every blog that comes up in my browser, but no luck. I'm sure
it's something simple.
Any help is greatly appreciated.
-Josh Nikle