Refresh "other" frame via ASP?

B

Bill Cohagan

I'm trying out ASP.Net and am currently trying to figure out how to refresh
the contents of one frame based on a button click in another frame. The
button in question is actually a server side control whose associated action
is to add a record to a database table. The "other" frame is displaying a
view of that table and I want it to automatically refresh to display the new
record.

Is there a way to accomplish this via ASP; i.e., without client side script?
Alternatively, do you know if I can have both client *and* server side
script associated with a button? Surely there is a "pattern" for this!

Boy it hurts to learn something new!

Thanks in advance,

Bill
 
B

bruce barker

google this newsgroup for details (pattern), but yes the refresh must be
done with client script, so you may need to combine if you need server
support also.

-- bruce (sqlwork.com)
 
J

Jacob Yang [MSFT]

Hi Bill,

Firstly I want to thank Bruce for this great help in this issue.

The server-side code has no sense to the html frameset, for only browser
makes sense to this concept. That is, we should look for a client-side
approach.

However, we can emit the appropriate client-side script that is used to
refresh other frames through the RegisterStartupScript method from
server-side code. The RegisterStartupScript method allows ASP.NET server
controls to emit client-side script blocks in the page. For more info on
this method, please check the articles below:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIPageClassRegisterStartupScriptTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/aspnet-injectclientsidesc.asp

Please let me know if it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top