|
protected void cmdSearchAll_Click(object sender, EventArgs e)
{
gv.PageIndex=e.NewPageIndex;
gv.DataBind();
}
apply this code...
Naik M
|
|
|
|
|
Hi naik,
How i will get e.NewPageIndex in buttonclick event???
i think u didnt got my problem..Actucally my problem is like.
i am using a button to fill the GridView.
when paging is enabled and Click the button it will show the result..
But when we change the gridview page(say page2), i have to click the Button again to view the second page...
please give me a solution
it is urgent
regards
faz
|
|
|
|
|
Hello All,
I m opening a pop up window from the web page(Asp.net/Vb.net) say (form1),
to open the window,im using,window.open(form2)
im fetching the data from the form2 back to form1,
while doing this,the data that already exists in the form1 is getting erased
,the page is getting refreshed
I can use sessions, but the amount of data that i have to transfer is large.
Can anyone suggest a way to fetch data from the other form,without refreshing the current page
Thanks in advance
Pls look into it,its very urgent
Regards,
Kavitha
|
|
|
|
|
As mch as i get ur problem is that u want to fetch the data from popoup window to parent window without refreshing the parent page. but where is the problem to keep the values in the session or u can use stringbuilder to transfer the value..
what problem r u facing to keep the values in the session.
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
thanks Aavesh,
actually,i have 3 datagrid in my form with some 10 columns and some 25 text fields,i need to transfer all these data back and forth whenver i open the pop-up window
and once i enter the data into the grid,im not saving it immediately,i ll have to save the entire page at a strech ,and when i fetch the data from the pop-up window,the data in grid is refreshed.
Pls suggest me some way,keeping performance alos in mind.
kavitha
|
|
|
|
|
hi
i had left one more point,i need to open the pop-up window for many fields,
like i need to select enquiryno from the form2,then customer name,product group,its something lik this
and i need to call different pop-up's for every field
kavitha
|
|
|
|
|
Place a hidden field in the parent document...try to access this hidden field in the childwindow through the javascript...(hint:use document.parent.getElementbyId...)..place all the required values into the hidden field probably with a delimiter .Now u can access this hidden field value easily inside the parent window
Koushik
|
|
|
|
|
When u close the Popup window r u refreshing the parent window. if u r doing this then dont refresh ur parent window then that time ur grid will not bind once again and get the values in the session.
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
hi Aavesh,
Ye,this is what im looking for,im not able to avoid the parent window from refreshing,as im putting the data from form2 into the textbox which is in parent window,parent window is refreshing
i have attached the code,like,how im calling the child window and how im going back to parent window.
let me knw,if i can correct something
calling pop-up window
------------------
"javascript:var w=window.open('Showdetails.aspx?ID=20','','menubar=No,toolbar=No,resizable=yes,scrollbars=yes,status=yes,width=550,height=200,left=150,top=200,screenX=200,screenY=200');"
going back to parent window
----------------------------
Dim script As String = "" + _
" window.opener.location = " + Chr(34) + "FST001_REG-ENQ.aspx?id=20&enquiryno=" + Session("enqno") + Chr(34) + "; " + _
" window.close() " + _
""
ClientScript.RegisterStartupScript(Me.GetType(), "CloseWindows", script)
kavitha
|
|
|
|
|
hi,
why r u using this window.opener.location. and i didn't get why did you passing this querystring when u have id is a static value and the enquiryno is already u have taken in session variable. u will diretly get the value of Session("enqno") in the parent window.
Instead of using this window.opener.location remove this line
and close the window with window.close() only.
Try this.
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
have you tried is it working or not....
|
|
|
|
|
hi
sorry,it should actually be,
Dim script As String = "" + _
" window.opener.location = " + Chr(34) + "FST001_REG-ENQ.aspx?id=20&enquiryno=" + enqno + Chr(34) + "; " + _
" window.close() " + _
""
ClientScript.RegisterStartupScript(Me.GetType(), "CloseWindows", script)
im using requery string in the parent window and accssing the enqno,so that no memory is allocated
i tried using session,but if i just simply close the child window,the page load event in the parent form is not firing,its not refreshing,at the same time,data is not pushed to the parent form
Any solution?
kavitha
|
|
|
|
|
found solution
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
|
|
|
|
|
yes.you can get all the values without refreshing page and also you dont need to get value in session.
follow step
suppose i have two textbox in form1 and one link button to open popup window.
now i am passing these textboxes id to popup window(Form2)
Javascript code
function OpenWindow(id1,id2)
{
ref = "Form2.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;
}
Pass Id1 and Id2 to openWindow function
linkButton.Attributes.Add("onclick","OpenWindow("+txt1.ClientID+","+txt2.ClientID+");");
Onclick of linkButon,popWindow will be open.
Now in form2, i have two textboxes and one button.
now onPageload event,save these two ids in hidden field, called hid1,hid2
onPage Load event
hid1.value=Request.QueryString["Id1"];
hid2.value=Request.QueryString["Id2"];
on click of button call javascript
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 />
}
best regard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
thanks pathan
ill try and let u knw
kavitha
|
|
|
|
|
im not able to open the second form(pop-up window)
no errr also
|
|
|
|
|
post your javascript and code
best regard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
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.
|
|
|
|
|