|
form1
---------
<script type="text/javascript"><br />
function OpenWindow(id1,id2){ref = "refreshform2.aspx?id="+id1+"&id2="+id2;var strFeatures="toolbar=no,status=no,menubar=no,location=no" strFeatures=strFeatures+",scrollbars=no,resizable=no,addressbar=no,height=250,width=220"newWin = window.open(ref,"TellObj",strFeatures);newWin.opener = top; }<br />
<br />
</script>
code behind
LinkButton1.Attributes.Add("onclick", "OpenWindow(" + id1.ClientID + "," + id2.ClientID + ");")
form2
---------------
<script type="text/javascript"><br />
function setValues()<br />
{<br />
opener.document.getElementById('hid1').value=document.getElementById('TextBox1').value;<br />
opener.document.getElementById('hid2').value=document.getElementById('TextBox2').value; self.close();<br />
}<br />
<br />
</script>
code behind-pageload
------------------
hid1.Value = Request.QueryString("Id1")<br />
hid2.Value = Request.QueryString("Id2")
kavitha
|
|
|
|
|
Are you getting javascript Error?
If no, then please check out javascript function with only alert box.
javascript function is called or not?
you must call javascript on every postback.
best regard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
hi
thanks a lot for u r help
i got the solution,but in slightly different way,
FORM1<br />
-----------------------------<br />
use html image button<br />
<br />
<br />
<br />
<br />
<script type="text/javascript"><br />
<br />
function Click()<br />
{<br />
window.open("form2.aspx");<br />
}<br />
<br />
</script><br />
<br />
<br />
<br />
call the click function<br />
-----------------------------<br />
<br />
<img src="Images/zoom.jpg" onclick="Click()" style="width: 25px; height: 16px" /><br />
<br />
<br />
form2<br />
--------------------<br />
<script type="text/javascript"><br />
function Click(code)<br />
{ <br />
window.opener.document.form1.txt1.value=code;<br />
<br />
window.close();<br />
}<br />
<br />
<br />
</script><br />
<br />
<br />
<br />
<br />
in form2 <br />
-----------<br />
under gridview_rowdatabound<br />
<br />
If e.Row.RowType = DataControlRowType.DataRow Then<br />
Dim linkbutton As LinkButton = CType(e.Row.FindControl("lblcd"), LinkButton)<br />
Dim code As String = linkbutton.Text<br />
refno = "ENQR" + "/" + code<br />
CType(linkbutton, LinkButton).Attributes.Add("onclick", "JavaScript:Click('" & <br />
<br />
refno & "');")<br />
End If
|
|
|
|
|
Hi,
I am using FIleUpload Control for uploading, But at by clicking upload button I am just displaying image not saving image.
I m using this statement:
imgIcon.Src = FileUpload1.PostedFile.FileName;
This works fine in IE but gives only filename in Mozilla. This statement gives full filepath in IE.
Naresh Patel
|
|
|
|
|
try to store the file temporarily at the server then show after showing delete the file just giving another way don't know it is proper or not
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
can u explain clearly what output you are expecting ....I actually dont get you question..
suchitamanandhar@hotmail.com
|
|
|
|
|
He want to show a image that is at client side before storing on the server side hope now its clear
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
I developed a web application and now i want to send this to my boss for his approval. He dont have .net installed in his PC, but he has to go through the application.How can this be possible?
Thank you.
|
|
|
|
|
it can be only done in one aspect if you upload ur site on server do ur boss hav any local server if so then upload ur application to that server now everyone who is connected with that can access ur site untill if he ont have dotnet install on his System. i Hope u got my point.
Sucess need one master Stroke '
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
Thanks..But i cant do that,because everybody can access that. Is there something that can be done with deploying?
|
|
|
|
|
if you want to deploy only on boss system then i think there can be two situtaion
1) your boss must have dotnet
2) you upload ur site on that server which is accesible only to your boss.
i think you have to choose one of the situtaion to acheive ur task.
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
Is your machine is connnected to your BOSS machine by LAN or something like that if yes then no need to deploy just access your machine or URL of your application from his machine if no
One solution could you call your boss to your desk and show him the DEMO
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
yaa this is also a another solution. which i forget..
Gr8 reply.
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
Hello guys,
here is what i am trying to do, i have a hashtable in a class that contains regular pairs(key,value)
when i click an "Add" button i fill the hashtable, so life is good
however when i try to search in the same hashtable after i fill it out , i click on a "Search" button
this is where i loose the hashtable content.
is there a way to keep the hashtable between page requests?
i am using ASP.net 1.1 and IIS6.0
Thank you for the fast response in advance
The Mage
|
|
|
|
|
Your class has no state between postbacks. You need to either stuff it into the session, or send it to the client in the viewstate. Someone told me yesterday that making it static would work, but I am dubious, LMK if you try it and it works.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
well i did make its static and still not working i am still getting a null hash
the viewstate is a good idea (performance wise) since it doesn't chew server resources but would you mind if you give me example?
my example is
public abstract class class1
{
public Hashtable htable;
public class1{
htable = new Hashtable();
}
public virtual void theOperation(int operationType,ListBox theControl,string filterPair){}
}
public class class2 : class1
{
public override void theOperation(int operationType,ListBox theControl,string textPair)
{
thePairList.Add(key,value);
// where/how can i do the viewstate???
}
Thank you
The Mage
|
|
|
|
|
You would need to work out how to serialise a hash table and then override loadviewstate and saveviewstate. Personally, I think sending it to the client every time is the thng to avoid, but.
Thanks for confirming my thoughts on the static thing.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
well,
thank you for the tip
i think i will just keep looking into it
The Mage
|
|
|
|
|
My ASP.NET page generates some HTML, then sticks it into a hiddenfield so a javascript can access it and write it to a popup window.
I had to disable validation for this page, as HTML inside a field triggers ASP.NET's cross-site scripting security.
Now, this was all working well and good until I changed my navigation menus from plain images and anchors to ASP:imagebuttons. The navi menu is on my masterpage and in now within the same block as the contentplaceholder. This is the only change I've done.
Now, when I click a button to go to a different page, all of my pages trigger the ASP.NET cross-site scripting security because of the hiddenfield on a single page.
Now, to try and fix this, I've set the hiddenfield's viewstate to false. I hope this would stop it from posting back, to no avail. Also, I've added the following event:
protected void reportField_Unload(object sender, EventArgs e)<br />
{<br />
reportField.Value = "";<br />
}
But still, the security is tripped. It seems like this hiddenfield is living way outside it it's scope... why?
-- modified at 16:05 Wednesday 10th October, 2007
Edit:
It seems the hiddenfield isn't living too long, it's just that its life is long enough to reach the other page's request validation.
So, it occurs to me that I can disable request validation with
<% Page ValidateRequest="false"%>
and then call Request.ValidateRequest() in the page's OnLoad event. The hiddenfield should be expired by then, and we still get input validation early enough for security, yes?
|
|
|
|
|
I have these pages:
1) DefaultMaster.Master/cs
2) MyPage.aspx/cs
3) BasePage.cs
MyPage.aspx is set to use the DefaultMaster masterpage. MyPage.cs inherits BasePage class (which is derived from the Page class).
How can I access methods and properties of the BasePage class from the DefaultMaster.Master.cs codebehind? I cannot find the right syntax to do it. Please help...
|
|
|
|
|
I assume the master page has a property that gives you the page, you then need to cast that to the BasePage type, preferably using the 'as' keyword and checking first that the cast succeeded.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a gridview and file upload control. When the user attaches a file then I need to add that file name to gridview. In grdiview i have 2 columns one for title and date added. Title is title of the file and date is Datetime.Now
How to add that information as a row to Gridview when they upload the file.
Thanks
|
|
|
|
|
The idea i can give you is that when you uplaod ur file save the name of file in the database and after that bind the table with gridview.
Hope it will work for you.
Sucess needs one Master Stroke
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
ya i also agree with Aavesh..
suchitamanandhar@hotmail.com
|
|
|
|
|
Mahimam wrote: How to add that information as a row to Gridview when they upload the file.
According to me it would be better if you can store the filenames in an ArrayList, after the file is finished uploading, and then bind this arraylist to the GridView. Simple isn't it?
|
|
|
|