|
Hello All,
I have problem, That is :
In my project I want to popup window from C# function in ASP.net2 and I want it as modal, so I use javascript function window.open() , But I haven't found how can i call this function from general c# function without using event's of button.
Can any help me, Please.
Ala Qunaibi
|
|
|
|
|
Hello,
You can try to use this:
ClientScript.RegisterClientScriptBlock(ClientScript.GetType(), "Focus", "" + "window.open('ImprimirGSA.aspx','frmImprimirGSA','width=650,height=500');" +
"");
The first parameter is the type, the second is a key to identify it and the thirst is the script.
|
|
|
|
|
Thanks.
|
|
|
|
|
i have declared a public propery like below in form1
public partial class Form1 : Form
{
string st;
public string s
{
get
{
return st;
}
}
private void Form1_Load(object sender, EventArgs e)
{
st = "MY PROPERTY";
}
}
and i tried to display this value in form2
using the statements
Form1 f = new Form1();
MessageBox.Show(f.s);
its not giving any errors but displaying nothing in messagebox
but if i initialize the st at the declatation instead of form1_load its displaying correct value
ex: public string st="MT PROPERTY";
please tell me why thats happening and how can i resolve this.
|
|
|
|
|
instead of initializing st in Form_Load ,initialize it in the constructor.
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
but if i need to assign that value after occurrance of some event then how could i get the content?
|
|
|
|
|
If you want to access a value that is present in the current instance of the form, you need a reference to that instance. If you create a new instance of the form, you will always get the same value, as it's a newly created and unused form.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
kalaveer wrote: private void Form1_Load(object sender, EventArgs e)
{
st = "MY PROPERTY";
}
kalaveer wrote:
Form1 f = new Form1();
MessageBox.Show(f.s);
You have initialised your variable when the Form Loads (Form_LOad event). This event is fired when the form is loaded (ie. displayed). As you have not shown your form your property has not been set
Form1 f = new Form1();<br />
f.Show();
MessageBox.Show(f.s);
|
|
|
|
|
Wow thats working but it displaying the form again how can i avoid this.
my first form already visible and with f.show() its displayed again i tried to make invisible but by setting visible property to false not working as f.show is just opposite of hiding na
please suggest
|
|
|
|
|
kalaveer wrote: Wow thats working but it displaying the form again how can i avoid this.
As I already explained, you need a reference to the existing form, not creating a new one.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
In your example, the Form_Load event has not been fired. You need to set the value in the constructor based on your logic.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Error while trying to running project: Unable to start debugging on the web server. you don not have permissions to debug the server.
verify that you are the member of the 'Debugger User' Groups on the webserver.
this is haneef
|
|
|
|
|
you have to be an administrator and/or add ur user name to the debugger users group,then only u can debug
"Change is the only constant thing in life
Either or survive or get extinct"
|
|
|
|
|
verify that you are the member of the 'Debugger User' Groups on the webserver
|
|
|
|
|
I have my windows application (C#) ready.
But whenever application shows a error message box,beep sound occurs.
I just want to disable this beep sound for message box at application level with minimum code changes.
Can u suggest me some way.
|
|
|
|
|
chravisankar wrote: i know this is not a relevant post here ,but please do not abuse like john.
this is in continuation with my previous post,
I have posted this because, i have seen in one of the posts here,some one has asked a question(NOT ME!),(i have neverasked anyone "urgent"). and people instead of answering him asked him not to put such posts.
People who abused me in filthy language,do not throw your words,it will ultimately harm you one day.i am a proud indian.people who abuse india,like john better abuse their own people
Urgent is a good way to anger people on this site, if you haven't already noticed. Another no-no is to cross post the forums
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
i agree!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Check it out, the OP deleted the thread but I have the message in my post :->
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
PaulC1972 wrote: That is why I make the attempt to put the question into my reply. Then they can delete it all they want but their question still sits there in my reply
thank you paul
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi there,
I hope that every .net programmer knows about app.ico. If not then create a windows application in c# and check out the working folder. You could see such a file there. This file is the picture file that is displayed in the exe file(check out debug folder of your application). Now what i need is, i want to change this app.ico through c# coding. Is it possible for changing the application icon at runtime without re-compiling? When i mention a .ico file, at runtime, this new .ico file should replace the existing default app.ico file and my .exe file in debug folder should also posses this image. How can this be made?
|
|
|
|
|
ok this is the fact, first you can do that for a very simple way, for instance:
System .Drawing .Icon nuevo=new Icon (@"D:\MyIconDirection.ico");
Random manual=new Random ();
int p = manual.Next (2);
if (p == 1)
base.Icon=nuevo;
else
base.Icon=null;
and I dont know, you can use for repeat that many times, a timer, thread, delegate to do that ashyncrons , you choose...
for any question or another think write me...
|
|
|
|
|
when the user clicks on a cell of the data grid, the entire row should get selected. how do i do it?
|
|
|
|
|
Set the SelectionMode property to FullRowSelect .
|
|
|
|
|
Private Sub datagrid_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles datagrid.CurrentCellChanged
dim cellcode as string= datagrid.Item(datagrid.CurrentRowIndex, 0<<
|
|
|
|
|
The following code work, but for any reason, the data did not save on the table. I can look at the data on the grid, but it is not saved.
<br />
table1TableAdapter.Insert("name1", "name2", "name3");<br />
table1TableAdapter.Update(db1DataSet1.Table1);<br />
the data did not save on the table. I want to know why and how to fix it.
|
|
|
|