|
Sorry if this question has already been answered... I'm new to asp.net and I've searched for an answer to no avail.
I'm trying to generate xml dynically to display a chart using a flash chart tool (xml/swf). The basic format I need for the xml is:
- <chart>
- <chart_data>
- <row>
<null />
<string>Constant 1</string>
<string>Constant 2</string>
<string>Constant 3</string>
<string>Constant 4</string>
</row>
- <row>
<string>Constant 5</string>
<number>(variable 1)</number>
<number>(variable 2)</number>
<number>(variable 3)</number>
<number>(variable 4)</number>
</row>
</chart_data>
</chart>
variable 1-4 are pulled from an Access DB dependent on a variable passed from the default page.
If anyone can point me in the right direction, I would greatly appreciate it!
Sorry for the problem with the code... I think I have it worked out now. It's strange. It looked fine in the preview. Sorry I just signed up for the forums today after finding a bunch of helpful posts and users. And it's not homework. It's a project I'm working on for a wedding website for my wife and I.
-- modified at 0:04 Tuesday 22nd May, 2007
|
|
|
|
|
1) Use the Ignore HTML tags checkbox to make your post more readable
2) Sounds like homework
only two letters away from being an asset
|
|
|
|
|
Sometimes some of my session ids loose their values when navigating from page to page on my an ASP .Net site causing errors. This happens when using Microsoft IE. When I run it in Foxfire this does not happen. What could be the problem?
|
|
|
|
|
FoxFire??
Browsers dont have anything to do with missing session variables. Session variables are stored in the web server and the browser does not have any control over their lifetime or value.
1. Check your code to see if the session variables are being reset anywhere you dont want them to be
2. The default session duration in IIS is 20 minutes. If you're in a page longer than that, doing nothing, then that session is considered as "closed"
Regards,
SG
|
|
|
|
|
I think it depends on what kind of session storage is being used: passing the session ID through the URL or using cookies. I want to say the cookie method is default. I have some session variables declared with everything at default. When I open up the developer toolbar in IE 6, I can clear the session cookies. That will effectively grind my application to a halt on the next postback. I can't find where the hell this session ID is so I can't say without a doubt that's what is going on.
|
|
|
|
|
This is correct with .Net session ID's are now stored in cookies and they are somewhat encrypted which is why you can't find them. In ASP they were server side but that can create a load. You can change where the session ID's are stored and if you have a small audience I would say do it server side. Hope this helps.
|
|
|
|
|
How do you change where the session ID's are stored? I would like to store them server side. On the page I'm having trouble there are about 12 session id's.
|
|
|
|
|
Here you go:
The magic is in the web.config:
(modify accordingly)
<sessionstate mode="Off|InProc|StateServer|SQLServer"
="" cookieless="true|false" <------!!!!!!!!
="" timeout="number of minutes" stateconnectionstring="tcpip=server:port" sqlconnectionstring="sql connection string" statenetworktimeout="number of seconds">
From my assumptions of your code and question, I am assuming .Net1.1 and you are not using a state farm or SQL for session management so select: mode=InProc andn cookieless=true
Here are more resources:
MSDN Link:
http://msdn2.microsoft.com/en-us/library/h6bb9cz9(VS.71).aspx
session FAQ:
http://www.eggheadcafe.com/articles/20021016.asp
cookiesless session problems:
http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=401
~We are the gifted few to have such awesome jobs!
|
|
|
|
|
Hi,
Iam loading a usercontrol into another usercontrol as following:
contentList.Controls.Add(Page.LoadControl("UserControls/FieldContentsList.ascx"));<br />
FieldContentsList fieldus=(FieldContentsList)contentList.Controls[0];<br />
this.Metakeywords=fieldus.Metakeywords;
Where contentList is a div html element in the parent usercontrol(which exist(registered) in the page).
I want to get the value of the loaded usercontrol property into the parent usercontrol property
but I get null.I put this code in the Page_Load method for the parent usercontrol.
Please help me to solve this problem...
I am too late but i will never give up
|
|
|
|
|
Have you made the properties of the child user control public or protected?
I would test the child control in the page, see if you can access the child control properties and then do the parent/child thing you are trying.
If we could look at the code it would help. User controls have always been a pain in the but for me.
|
|
|
|
|
Hi Everyone
Dont know if someone already asked this. I am doning a page that have quite a lot of postpacks in asp.net. My question is. When I am halfway down the page and do a postback the page return back to the top. Is there a way that I can tell it to go back to the section where the postback occured? (halfway down the page). Something similar like a bookmark in html that takes you to a specific place in that document.
Regards,
Elizma
|
|
|
|
|
Hi,
you can try MaintainScrollPositionOnPostback in the page section of the aspx page.
Eg:
<%@ Page Language="C#" ..... MaintainScrollPositionOnPostback=true .. %>
Gud Luck.
Deepak Surana
|
|
|
|
|
You could also look into using AJAX methods
only two letters away from being an asset
|
|
|
|
|
If you are using .net 1.1 use smart navigation by setting page argument smartnavigation to true.
<%@Page language="c#" Codebehind="test.aspx.cs" AutoEventWireup="false" smartNavigation="True"%>
Gg
|
|
|
|
|
Hi ,
I am displaying a pop-up on a click of a button in my page.
I want to close the pop-up on the click of a certain button in the pop-up as well as want to refresh the parent page as the pop up closes.
Plz help.
Thanks a ton
Deepak Surana
|
|
|
|
|
Look at window.opener
only two letters away from being an asset
|
|
|
|
|
Thanks a lot.
And one more question, how can i show a message saying something like "Saved" and then close the pop up after the user clicks on ok
Deepak Surana
|
|
|
|
|
alert('saved');
window.close();
Gg
|
|
|
|
|
Hi,
you have to add a attribute to that button during the page load event of the form that would call the popup .the code for that is like:
**********************************************
loginButton.Attributes.Add("onclick", "window.showModalDialog('/MyWebsite/login.aspx', null, 'status:no; dialogWidth:360px; dialogHeight:229px; help:no; scroll:no; menubar:no; resizable:no')");
***********************************************
This code is for modalDialog
or for popup
button.Attributes.Add ("onclick", "javascript: functiontoopenpopup();");
this will open the popup window.
In the popupwindow code....on the Page_unload you have to write this code.
*****************************************
window.close();
window.opener.location.reload();
*****************************************
This will close the popup and refresh the parent window.
Regards,
Kaps
|
|
|
|
|
Hi,
I have two DropDownLists that I want the value of each selection to be displayed on a secondary Label/Text field without posting back, like if I was using both, CascadingDropDown and DynamicPopulateExtender, over the same DropDownList.
I was wondering if that can be done with the ATLAS components or if I need to implement it in AJAX?
Does anyone know how can I implement this?
obs.: I'm already using the CDDs and they are working fine, I just need the selected value to be displayed on the Label/Text, every time the selection changes.
Thank you very much in advance.
Doug
|
|
|
|
|
Hello,
I have searched the online for a solution but have not been able to find something to meet my needs.
Right now, we have a process at work in which the someone needs to login to a web page and upload resumes to a web system owned by my company. It's a standard SSL secured web page, with a textbox for a login name and password.
They want me to write something that automates this process, so they can just click a button and have the login and submission done automatically.
I'm having trouble with the very first step: logging in. Everything that I have been finding online regarding screen scraping and credentials says that I should just send the information through by POSTing the login and password in the http headers, but does this work with a SSL web page?
What I really need to know how to do is simulate the entering of text boxes on a web page, and the clicking of the submission button. Is this possible with ASP.NET or C#?
Thanks!
|
|
|
|
|
If you write a windows app that uses the webBrowser control, you can auto populate text boxes and click buttons. I can give you some sample code if you are interested. I would need to know if this is in .net 1.1 or .net 2.0. It sounds like you are using C#.
Ben
|
|
|
|
|
Thank you so much! I am using .Net 2.0
|
|
|
|
|
Ok, there are several steps so I will try to make sure I don't forget any of them.
First you need a new windows app project
Next you need to add the webBrowser control on the form. It should show up on your tools bar. If not just right click on the tools bar and select choose item. Find the webBrowser in the dialog and add it.
Next you need to add a reference to a com dll.
Go to references in your solution explorer, right click add reference. Select the com tab and then find the Microsoft HTML Object library.
Next create a form load event or a button click event to launch this.
In the button click event add this code:
webBrowser1.DocumentCompleted +=
new WebBrowserDocumentCompletedEventHandler(CompleteDocument);
webBrowser1.Navigate(@"your url here");
You will need a documentcomplete event so you know when the page has loaded.
private void CompleteDocument(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
HtmlElement he = null;
he = webBrowser1.Document.GetElementById("htmlinputnamehere");
if (he != null)
{
((mshtml.HTMLInputElementClass)he.DomElement).value = "setthetext";
}
he = webBrowser1.Document.GetElementById("htmlinputnamehere2");
if (he != null)
{
((mshtml.HTMLInputElementClass)he.DomElement).value = "setthetext2";
}
he = webBrowser1.Document.GetElementById("htmlbuttonnamehere");
if (he != null)
{
((mshtml.HTMLInputElementClass)he.DomElement).click();
}
}
You can view source of your web page to see what the input text boxes are along with what the button name is so the code will work.
NOTE since the documentComplete event happens each time the page loads you may need to keep track of when you want certain code to run.
Anyway, that should give you enough to start.
Ben
|
|
|
|
|
This seems like exactly what I've been needing. I tried to do something very similar with Javascript, but was held back with security restrictions between frames and pages. I didn't realize C# and ASP.NET could work with the web page elements like this. I'll try this out as soon as I can. Thank you very much for the help!
|
|
|
|