|
betreyal wrote: I need to pass values back to page1, so that page1 can put them on the pdf.
Explain this. Which value(from Page2?) you want to pass on Page1? Once you put that value in Page1, how are you planning to put that in PDF as you said, Page1 triggers(lets say from a button) to open up a PDF.?
|
|
|
|
|
1) In page2 the user is selecting a value from a GridView. From there, with a little work, I am passing it to a HiddenValue in the aspx of Page1, but what i need to do is pass it to a javascript function in Page1, because Page1 is just used for processing forms and doesn't actually ever show itself to the user.
2) All the work in passing the value to the PDF has been set up, i just need to get the value to the javascript function, and the function will pass it to the PDF.
Elaboration:
How it will all work is the user will select a form; Page1 actually processes this request and opens up the correct form, which is a PDF. On the PDF there are buttons and fields for data entry. On the button click, since the PDFs use javascript for processing actions, the pdf goes back to Page1 , where Page1 determines which popup to open depending on the button clicked. From here Page2 would be opened. A GridView of stuff is displayed for the user to choose from. The user double clicks any of the values they want, and then the page closes, passing the value to Page1. The problem is im passing the value to a HiddenField. What I need is a way to call the javascript function on Page1 from Page2. With this, I will be able to pass the values I need into the function, and they in turn will get posted to the PDF.
I hope that's clearer. Any more questions?
Thanksmodified on Friday, March 12, 2010 4:36 PM
|
|
|
|
|
|
Passing the value isn't the problem; I can already pass it to a hidden value, the problem is I need to call a javascript function from a different page.
|
|
|
|
|
|
You were right. You can use opener to call javascript functions from other pages. I got it with this:
window.opener.FunctionName(Param1, Param2);
assuming it has parameter.
|
|
|
|
|
Hi,
You can try the code below:
Child page:
if (!IsPostBack)
{
CloseButton.Attributes.Add("onclick","return _SetValue();");
}
function _SetValue()
{
var lblRelated = window.opener.document.getElementById('Related');
var lblQuery = document.getElementById('Query');
lblRelated.innerText = lblQuery.innerText;
window.close();
}
Hope it helps
modified 27-May-14 4:49am.
|
|
|
|
|
This isn't working to call a function on my other page. Javascript isn't really my thing, though. Is there something I might be missing?
|
|
|
|
|
Any idea on how I could maybe use a callback function? I don't know how to use them, and google/bing are not helping.
|
|
|
|
|
Hi
I have a hiddenfield, which I want to save the scroll position of asp.panel scrollbar during postback, and when during postback this value is called back to set the scroll position.
Using javascript I can grab the value from the scrollbar, and assign it to the hidden field, but when I post the page back the value has gone.
Here is my code snippet:
<script type="text/javascript" language="javascript">
function SetScroll(val) {
alert(document.getElementById('div1').childNodes('ScrollPos').value);
}
function ScrollTo(what) {
var test = what.split('/');
document.getElementById(test[0]).scrollTop = document.getElementById('div1').childNodes('ScrollPos').value;
}
</script>
<div id="div1" class="Style">
<input type="hidden" id="ScrollPos" name="Pos" runat="server" enableviewstate="true"/>
<asp:Panel ID="pnl1" runat="server" Enabled="true" Height="600px" ScrollBars="Vertical"
Width="100%" onscroll="javascript:SetScroll(this);">
<br />
<div class="divTagBGColours">
</div>
<br />
<asp:BulletedList ID="BulletedList2" runat="server">
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
<asp:ListItem Text="Hello" Value="blah" />
</asp:BulletedList>
</asp:Panel>
</div>
protected void Page_PreRender(object sender, EventArgs e)
{
EnsureChildControls();
if (!IsPostBack)
{
Session["panelNames"] = pnl1.ClientID;
Session["panelNames"] += "/" + pnl2.ClientID;
Session["panelNames"] += "/" + pnl3.ClientID;
string var4 = Session["panelNames"].ToString();
Session["panels"] = "ScrollTo('" + var4 + "');";
((HtmlControl)(this.Page.Master.FindControl("mainBody"))).Attributes.Add("onload", Session["panels"].ToString());
string var = ScrollPos.Value;
}
}
Am I missing something? How do I keep the value during post back?
|
|
|
|
|
Does this help: Maintain Scroll Position on Postback[^]. Not checked it but it looks close to what you want. Took 1 second to Google that. Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
That deals with maintaining the scroll position of the page, not an individual element within the page. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yup, you're right: just saw scroll and maintain.Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
maintainscrollposition does not work on asp:panels - I checked that too
|
|
|
|
|
First, format the code you post using the pre tags
Second, Do not repost the same question, continue with the original thread. where everyone can see the previous responses and reply to gain context.
I know the language. I've read a book. - _Madmatt
modified on Friday, March 12, 2010 10:30 AM
|
|
|
|
|
It seems you are just throwing things together at this point with very little understanding of ASP.NET and hoping that it works.
I would suggest you step back, take some time to understand ASP.NET and in particular maintaining state for controls or values within a page, then come back to the problem at hand after you have the knowledge. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi friends,
I have installed my website to server under Default website in IIS.
then i open a crystal report then it allows me to take print from crystal reports print option.
but when i add new website in iis (on clicking the website then new website and add new website).
then i installed my website their then i m not able to take print from crystal reports print option.
the images of print button in crystal report are not displayed on their places and when i click there it gives JavaScript error.
Please help me on this.
Regards,
Gourav Tyagi
|
|
|
|
|
Try reading a little about ASP.NET deployment[^] I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all,
Could u pls tell me How do we find out During Month transactions took place in our Database. i want to find out only updated rows in current month from my database. multiple users r updating their data by ASP.Net pages. could u pls tell me how can i...
Thanks
************ S G KORE *******************
|
|
|
|
|
Do you have a date/time stamp on a transaction table?
If not you are out of luck, unless you only want the last update date/time of a record then you still need a date/time stamp on the record.
|
|
|
|
|
The content page on my website is loaded thru an xml.
Now I want to change the text box as a label evrytime there is a value returned from database otherwise a textbox. Currently it always returns a text box as below.
- <element type="cdu:CDUText" binding="Shares/IndividualShare[i]/FirstName" id="CDUText_FirstIndv" width="Narrow">
<validator type="cdu:CDURequiredValidator" id="CDURequiredValidator_FirstIndv" message="First Name is required" />
</element>
|
|
|
|
|
|
Hello,
I have a drop down list with some items.
I need to disable some items (not selectable) from this list.
How can i implement this.
Please reply..
|
|
|
|
|
I would have thought it better not to show them in the first place: you should never show a user options that thay have no access to: what would be the point?
For example, knowing the user you could tailor the list items to suit rather than faffing around trying to hide unwanted items.Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
we can not disabled the few items of listbox better not to fill them.... Rating always..... WELCOME
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|