473,786 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.showMod alDialog) . 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 1853
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.EventArg s) _
Handles MyBase.Load
Label1.Text = Now.ToLongTimeS tring
Dim sb As New System.Text.Str ingBuilder
sb.Append("java script:window.s howModalDialog" )
sb.Append("('ht tp://authors.aspalli ance.com/kenc/',")
sb.Append(" '','');return true;")
Button1.Attribu tes.Add("onclic k", 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*******@disc ussions.microso ft.com> wrote in message
news:33******** *************** ***********@mic rosoft.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.showMod alDialog) . 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.Session ID 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.EventArg s) _
Handles MyBase.Load
Label1.Text = Now.ToLongTimeS tring
Dim sb As New System.Text.Str ingBuilder
sb.Append("java script:window.s howModalDialog" )
sb.Append("('ht tp://authors.aspalli ance.com/kenc/',")
sb.Append(" '','');return true;")
Button1.Attribu tes.Add("onclic k", sb.ToString)
End Sub
<form id="Form1" method="post" runat="server"> <P><asp:Label id="Label1" runat="server"> Label</asp:Label></P><P><asp:Butto n id="Button1" runat="server" Text="Pop"></asp:Button></P></form>

Ken
"Patrick" <an*******@disc ussions.microso ft.com> wrote in message
news:33******** *************** ***********@mic rosoft.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.showMod alDialog) . 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
2278
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 system that is a munch of ASP, ASP.NET with hard-core client side JScript, VBScript (client-side) and ActiveX controls. The problem in question involves functionality that is common to an ActiveX control delivered to the client. I have never...
6
7742
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. Because I don't want a post-back, I added some javascript to do this However, using client-side JS, I cannot enable any controls that have been disabled by server-side code. If the control is initially enabled, I can disable/enable it client-side.
1
2533
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 by the client only. e.g. <input type="text" name="emp_name"> 2. HTML Server Control: understood by the server only. e.g. <input type="text" name="emp_name" runat="server"> 3. Web Server Control: understood by the server only. e.g. <asp:TextBox
2
1651
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 controls, since it has the attribute runat="server", so the controls will be processed in web server?? Do you think the processing time will be slower than tradiational ASP applications?? I guess the fundamental question is when do we use...
4
2375
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 any get arounds for this problem apart from the traditional JavaScript?
14
6311
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) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in ControlToValidate property in two ways as I mentioned. Please advise. Thanks!
5
2604
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 when it's best to use server side events. For example, if a textbox is to contain a date I want to validate the date when that textbox loses the focus. If the date is not valid I make visible a label next to the textbox telling the user it's
1
3950
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 the same issue. However, none of the suggested fixes solved my particular problem. I tracked down the cause of the problem, which is related to aspx page parser's handling of controls inside html comments. The problem may be quite common and well...
5
1896
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 controls on that page, before transferring focus to the browser-page and showing it to the user? (the user would be responsible for submitting the page.)
10
2053
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 whole day is then displayed in cels of a table. The user has then to click in a cel representing a hour of the day and an object (book ..), and finally click on the submit button to insert that reservation in the database. My problem is: there...
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.