473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Client side code and server controls.

Gang
I have an ASP.NET page with a series of datagrids on in it. I also have an html button control (on the same page) that runs client side script to display a modal dialog box (window.showModalDialog) . when this modal dialog returns, i want a couple of datagrids on the page to refresh their contents. does anyone know a good way to handle this?
Nov 18 '05 #1
3 1823
Hi Patrick,

Do you really need to use an HTML button? A server-side button can be made
to do what you need quite nicely. You add the javascript to the onclick
attribute and return true. The page will refresh itself!

Here's a little demo that uses a label and a button. Notice how the time on
the label updates on the refresh. Grids would do about the same
refresh-wise.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Label1.Text = Now.ToLongTimeString
Dim sb As New System.Text.StringBuilder
sb.Append("javascript:window.showModalDialog")
sb.Append("('http://authors.aspalliance.com/kenc/',")
sb.Append(" '','');return true;")
Button1.Attributes.Add("onclick", sb.ToString)
End Sub
<form id="Form1" method="post" runat="server">
<P>
<asp:Label id="Label1" runat="server">Label</asp:Label></P>
<P>
<asp:Button id="Button1" runat="server" Text="Pop"></asp:Button></P>
</form>

Ken
"Patrick" <an*******@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
Gang,
I have an ASP.NET page with a series of datagrids on in it. I also have
an html button control (on the same page) that runs client side script to
display a modal dialog box (window.showModalDialog) . when this modal
dialog returns, i want a couple of datagrids on the page to refresh their
contents. does anyone know a good way to handle this?


Nov 18 '05 #2
thanks ... i'll give this a try and get back in a sec ...
Nov 18 '05 #3
ok...so far so good. thanks. i have another question. the first time the window that is spawned (through the call to showModalDialog), the Session.SessionID value (Page_Load and ispostback is false) is different from all subsequent reloads of that page. after the first Page_Load the sessionID value remains the same. This is important because on that first call I am caching a couple of datasets. These are lost on the next Page_Load because the Session object has changed. Any ideas as to how I can prevent the Session object from changing between the initial page load and all other reloads?

----- Ken Cox [Microsoft MVP] wrote: -----

Hi Patrick,

Do you really need to use an HTML button? A server-side button can be made
to do what you need quite nicely. You add the javascript to the onclick
attribute and return true. The page will refresh itself!

Here's a little demo that uses a label and a button. Notice how the time on
the label updates on the refresh. Grids would do about the same
refresh-wise.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Label1.Text = Now.ToLongTimeString
Dim sb As New System.Text.StringBuilder
sb.Append("javascript:window.showModalDialog")
sb.Append("('http://authors.aspalliance.com/kenc/',")
sb.Append(" '','');return true;")
Button1.Attributes.Add("onclick", sb.ToString)
End Sub
<form id="Form1" method="post" runat="server"><P><asp:Label id="Label1" runat="server">Label</asp:Label></P><P><asp:Button id="Button1" runat="server" Text="Pop"></asp:Button></P></form>

Ken
"Patrick" <an*******@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
Gang,
I have an ASP.NET page with a series of datagrids on in it. I also have
an html button control (on the same page) that runs client side script to
display a modal dialog box (window.showModalDialog) . when this modal
dialog returns, i want a couple of datagrids on the page to refresh their
contents. does anyone know a good way to handle this?

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephanie Stowe | last post by:
Hi. I have never worked on a project that requires IE. So I have done the vast majority of my work server side, delivering cross-browser compliant HTML to the client. I am working on a bug fix to a...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
1
by: Matthew Louden | last post by:
Personally, I am totally confused with the following control terms and usage and advantages of each one in ASP.NET web application. Here's what I know so far.. 1. HTML Client Control: understood...
2
by: Matt | last post by:
I guess the principal differences between client-side and server-side code is that client-side code is processed in web browser, and server-side code is processed in web server. In ASP.NET web...
4
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
5
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and...
1
by: Hong Hao | last post by:
Recently, I was trying to modify an existing aspx page when client-side validation on that page stopped working. I searched this group and the web in general and found that other people have had...
5
by: John A Grandy | last post by:
is it possible to write a vb.net code (intended to run on the client-side) that would invoke an instance of IE, have it download a page from a certain URL, and then pre-populate some of the...
10
by: Ben | last post by:
Hi, I made an application in classic asp (reservation of books and video stuffs for students) and want to migrate to asp.net. The user has to chose a date, then pushung on a submit button. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.