Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Thursday, March 29, 2012

Pass parameter to Popup window

I have 2 webform in vb.NET application.
On Webform1, I have one text box1 and one button.
on Webform2, I have one text box .
I need transfer the value of textbox 1 in webform1 to textbox2 in
webform2. and popup webform2 when user click on the button on webform1.
I have code in webform1:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Button1.Attributes.Add("onclick", "window.open('WebForm2.aspx?a=" +
TextBox1.Text.ToString + "',null,'height=250, width=250,status= no,
resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');")
End Sub
and following code in webform2:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Text = Request("a").ToString
End Sub
I could not get the result unless I click on the button1 twice. i know
what happen in here but have no solution. I will be appreciated if you
could help here.
Thanks in advanced,
DiHi ,
You can achieve this by injecting a javascript in the Button1 click
event on the server side . Write an function to inject an javascript in the
webform1 button1 click.
Don't do anything with Attributes of button1 as it won't achieve result u
requires as the 1st page the textbox1 value would be blank.
private void openWindowInjectScript(){
string myScript;
myScript = "<scr" + "ipt>window.open('WebForm2.aspx?a=" + txtIdfield.Value
+ "',null,'height=250, width=250,status= no,resizable= no, scrollbars=no,
toolbar=no,location=no,menubar=no'); </scr" + "ipt>";
this.Page.RegisterStartupScript("JavaScript",myScript);
}
In the webform1.aspx button1_Click event
private void Button1_Click(object sender, System.EventArgs e)
{
openWindowInjectScript();
}
Basically openwindowInjectScript register a script at pageload and which
will make to open an window with current values.
This is the way out for it and it should work
Regards
IntelYogi
"dyw55a@.yahoo.com" wrote:

> I have 2 webform in vb.NET application.
> On Webform1, I have one text box1 and one button.
> on Webform2, I have one text box .
> I need transfer the value of textbox 1 in webform1 to textbox2 in
> webform2. and popup webform2 when user click on the button on webform1.
> I have code in webform1:
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Button1.Attributes.Add("onclick", "window.open('WebForm2.aspx?a=" +
> TextBox1.Text.ToString + "',null,'height=250, width=250,status= no,
> resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');")
> End Sub
> and following code in webform2:
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> TextBox1.Text = Request("a").ToString
> End Sub
>
> I could not get the result unless I click on the button1 twice. i know
> what happen in here but have no solution. I will be appreciated if you
> could help here.
> Thanks in advanced,
> Di
>
Thank you for your reply. But actually I tried and this did not work
for some reason, any idea?
Try this onClick event of your button
Response.Write("<SCRIPT>");
Response.Write("window.open('page,aspx?value=" + myval +
" ',null,'height=200,width=900,status=yes,
toolbar=no,menubar=no,location=no')
;
");
Response.Write("</SCRIPT>");
I think this will do the trick, tell me if not
dyw55a@.yahoo.com wrote in message news:<1117647067.875660.133640@.g43g2000cwa.googlegroups.c
om>...
> Thank you for your reply. But actually I tried and this did not work
> for some reason, any idea?

Pass parameter to Popup window

I have 2 webform in vb.NET application.
On Webform1, I have one text box1 and one button.
on Webform2, I have one text box .
I need transfer the value of textbox 1 in webform1 to textbox2 in
webform2. and popup webform2 when user click on the button on webform1.

I have code in webform1:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Button1.Attributes.Add("onclick", "window.open('WebForm2.aspx?a=" +
TextBox1.Text.ToString + "',null,'height=250, width=250,status= no,
resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');")
End Sub

and following code in webform2:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Text = Request("a").ToString
End Sub

I could not get the result unless I click on the button1 twice. i know
what happen in here but have no solution. I will be appreciated if you
could help here.

Thanks in advanced,
DiHi ,
You can achieve this by injecting a javascript in the Button1 click
event on the server side . Write an function to inject an javascript in the
webform1 button1 click.
Don't do anything with Attributes of button1 as it won't achieve result u
requires as the 1st page the textbox1 value would be blank.

private void openWindowInjectScript(){
string myScript;
myScript = "<scr" + "ipt>window.open('WebForm2.aspx?a=" + txtIdfield.Value
+ "',null,'height=250, width=250,status= no,resizable= no, scrollbars=no,
toolbar=no,location=no,menubar=no'); </scr" + "ipt>";
this.Page.RegisterStartupScript("JavaScript",myScript);
}

In the webform1.aspx button1_Click event
private void Button1_Click(object sender, System.EventArgs e)
{
openWindowInjectScript();
}
Basically openwindowInjectScript register a script at pageload and which
will make to open an window with current values.

This is the way out for it and it should work

Regards
IntelYogi

"dyw55a@.yahoo.com" wrote:

> I have 2 webform in vb.NET application.
> On Webform1, I have one text box1 and one button.
> on Webform2, I have one text box .
> I need transfer the value of textbox 1 in webform1 to textbox2 in
> webform2. and popup webform2 when user click on the button on webform1.
> I have code in webform1:
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Button1.Attributes.Add("onclick", "window.open('WebForm2.aspx?a=" +
> TextBox1.Text.ToString + "',null,'height=250, width=250,status= no,
> resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');")
> End Sub
> and following code in webform2:
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> TextBox1.Text = Request("a").ToString
> End Sub
>
> I could not get the result unless I click on the button1 twice. i know
> what happen in here but have no solution. I will be appreciated if you
> could help here.
> Thanks in advanced,
> Di
>
Thank you for your reply. But actually I tried and this did not work
for some reason, any idea?
Try this onClick event of your button

Response.Write("<SCRIPT>");
Response.Write("window.open('page,aspx?value=" + myval +
"',null,'height=200,width=900,status=yes,toolbar=no ,menubar=no,location=no');
");
Response.Write("</SCRIPT>");

I think this will do the trick, tell me if not

dyw55a@.yahoo.com wrote in message news:<1117647067.875660.133640@.g43g2000cwa.googlegroups. com>...
> Thank you for your reply. But actually I tried and this did not work
> for some reason, any idea?
i'd tried both suggest solutions from Yogi, but it seems not work for me...is any solution yet?

the prob is...webform2's page_load will be run 1st b4 the button_click event run...so any wisdom can help up?

From http://www.developmentnow.com/g/8_2...opup-window.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Monday, March 26, 2012

pass the arguments from web to windows

Hi all,
I have created one web applicatication which contains button.When I
click the button
I want to pass arguments to windows application.Can I do it?Any one
please help me...
Regards justinHi,
How about this code:

string strArg = @." the arguments comes here";

process.StartInfo.Arguments = strArg;

process.StartInfo.UseShellExecute = false;

process.StartInfo.RedirectStandardOutput = true;

try

{

process.Start();

}

catch(Exception ex)

{

string str = ex.Source + ex.Message + ex.StackTrace;

}

Thanks and Regards,
Manish Bafna.
MCP and MCTS.

"justin" wrote:

Quote:

Originally Posted by

Hi all,
I have created one web applicatication which contains button.When I
click the button
I want to pass arguments to windows application.Can I do it?Any one
please help me...
Regards justin
>
>


The simplest (or one of the simplest) way of communicating between
applications is via text files. One guy writes, another reads.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"justin" <justindhasy@.gmail.comwrote in message
news:1166424002.419061.231640@.j72g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hi all,
I have created one web applicatication which contains button.When I
click the button
I want to pass arguments to windows application.Can I do it?Any one
please help me...
Regards justin
>

pass the arguments from web to windows

Hi all,
I have created one web applicatication which contains button.When I
click the button
I want to pass arguments to windows application.Can I do it?Any one
please help me...
Regards justinHi,
How about this code:
string strArg = @." the arguments comes here";
process.StartInfo.Arguments = strArg;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
try
{
process.Start();
}
catch(Exception ex)
{
string str = ex.Source + ex.Message + ex.StackTrace;
}
Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"justin" wrote:

> Hi all,
> I have created one web applicatication which contains button.When I
> click the button
> I want to pass arguments to windows application.Can I do it?Any one
> please help me...
> Regards justin
>
The simplest (or one of the simplest) way of communicating between
applications is via text files. One guy writes, another reads.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"justin" <justindhasy@.gmail.com> wrote in message
news:1166424002.419061.231640@.j72g2000cwa.googlegroups.com...
> Hi all,
> I have created one web applicatication which contains button.When I
> click the button
> I want to pass arguments to windows application.Can I do it?Any one
> please help me...
> Regards justin
>

Pass Username and Pwd to database query in WebMartix?

I have an application that uses a login screen to pass UserName and Password to a details page. Then I use a SELECT query to generate a datagrid using UserName and Pwd as WHERE clause.

I have inserted a couple of label.texts to verify the variable make the second page.

How do I get the query to limit the return to only the records matching the UserName & Pwd combination?

Thanks,
ScottYou don't really want to pass the password around your site. And hopefully you're not allowing multiple duplicate usernames as long as the password is different.

If you're using asp.net authentication then it's somewhat safe to assume that the username is valid once they're logged in.

I.E. on your login page you set an authorization cookie.

On your details page you access their username via this cookie and use that as a parameter to your stored procedure/SQL Query.

Friday, March 16, 2012

Passing a Varible Issue With Zonealram Pro

Hi All,

I am not able to pass a varible when testing an asp.net application on my local machine unless i disable Zonealram Pro......has anyone else had this issue/know what to do ?

regards

TonyThis is very interesting. Are you trying to pass a normal variable or a session variable? Does everything else in your app work with ZA enabled? Are you able to connect to the internet?

I have the free ZA on my machine at home, and I've never experienced any compatibility issues with .NET. ZA Pro does a few more things than the free version, but nothing that should cause what you're seeing.

The one problem I do consistently have with ZA though is if I reboot my machine, I can't connect to the internet without stopping and restarting ZA. Maybe you could try that and see if it makes a difference. Please keep us posted, I'd really be curious to figure this one out.

Jeff
I use ZA Pro 4.5. When its Ad Blocking setting is set to "High", it does not preserve session state. I think it loses the sessionID and that leads to creating a new Session object with each post back.

When I test my own code that uses a Session object, I turn off Ad Blocking until I am finished.

I hope this helps.
Hi All,

thanks for your posts.

I am passing a session variable......and this works fine with the free zonealarm.....so PL you must be correct....I did lose a days work over this......re-wrorte my code 9 times...at least...:(

so watch out !

rgs

Tony