473,395 Members | 1,689 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,395 software developers and data experts.

Webform Question

Hi,

In my C#.Net 1.1 Web form project, I have WebFormParent and WebFormChild.
The WebFormParent has a button btnToChild.
How will thd code like so when I click the btnToChild, the browser will
launch WebFormChild?
Thanks for help.

Jason
Mar 22 '06 #1
3 1144
Hello Jason,

Add OnClick handler to your button where specify window.open JS function.
See sample below. Put this in OnPageLoad

btn1.Attributes.Add("onclick", "javascript:Window.Open('<yourURL>')");
probablly you could build a url string with query string
and call like "javascript:Window.Open("&strUrl&")"

JH> Hi,
JH>
JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
JH> WebFormChild.
JH> The WebFormParent has a button btnToChild.
JH> How will thd code like so when I click the btnToChild, the browser
JH> will
JH> launch WebFormChild?
JH> Thanks for help.
JH> Jason
JH>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 22 '06 #2
Thanks Michael.
But will be the codes put in the "private void btnToChild_Click(object
sender, System.EventArgs e)", so when I Click the btnToChild in the
WebFormParent, it then will go to WebFormChild?
"Michael Nemtsev" <ne*****@msn.com>
???????:9c**************************@msnews.micros oft.com...
Hello Jason,

Add OnClick handler to your button where specify window.open JS function.
See sample below. Put this in OnPageLoad

btn1.Attributes.Add("onclick", "javascript:Window.Open('<yourURL>')");
probablly you could build a url string with query string and call like
"javascript:Window.Open("&strUrl&")"
JH> Hi,
JH> JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
JH> WebFormChild.
JH> The WebFormParent has a button btnToChild.
JH> How will thd code like so when I click the btnToChild, the browser
JH> will
JH> launch WebFormChild?
JH> Thanks for help.
JH> Jason
JH> ---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche

Mar 22 '06 #3
Hello Jason,

You can't put this code into the ?# one, because it's client JS. You only
can call RegisterStartupScript to registrate this

JH> Thanks Michael.
JH> But will be the codes put in the "private void
JH> btnToChild_Click(object
JH> sender, System.EventArgs e)", so when I Click the btnToChild in the
JH> WebFormParent, it then will go to WebFormChild?
JH> "Michael Nemtsev" <ne*****@msn.com>
JH> ???????:9c**************************@msnews.micros oft.com...
JH>
Hello Jason,

Add OnClick handler to your button where specify window.open JS
function. See sample below. Put this in OnPageLoad

btn1.Attributes.Add("onclick",
"javascript:Window.Open('<yourURL>')");

probablly you could build a url string with query string and call
like
"javascript:Window.Open("&strUrl&")"
JH> Hi,
JH> JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
JH> WebFormChild.
JH> The WebFormParent has a button btnToChild.
JH> How will thd code like so when I click the btnToChild, the
browser
JH> will
JH> launch WebFormChild?
JH> Thanks for help.
JH> Jason
JH> ---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 22 '06 #4

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

Similar topics

1
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
2
by: *no spam* | last post by:
I'm trying to figure out how to create a tabControl in a WebForm (I'm a newbie - sorry if this is a dumb question :) I've been able to set it up in a Windows Form, but would prefer to get it...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
5
by: mg | last post by:
What code will automatically launch a WebForm (C#) when the session timeout (set in Web.config) has elapsed
3
by: Harry | last post by:
Dear all, It is found that when a webform control trigger an event, Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub This...
3
by: Aitham alama | last post by:
Hi There, My question is as following, I have a webform (Webform1) which contains one label control and command button, when the user clicks the button another webform (Webform2) appears,...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
1
by: ffhansix | last post by:
Hi, I have migrated a web site from .NET 1.1.4322 to .NET 2.0. After the migration my Modal webform does not work as it did in 1.1. The webform pops up from a page when a user clicks a button:...
3
by: Nuno | last post by:
How can I instantiate a webform2 object from webfrom1 codebehind? The class does not popup in intellisense and gives me and error if i try to create it. Nuno
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.