|
just an fyi- make sure you provide the html control name when incorporating it within the script string... server controls sometimes take a different name once the result page is sent from the server back to the client.
Now, why would anyone be interested in server-side validation? Postbacks are very inefficient! To validate without making round trips to the server, look into using validation controls such as RegularExpression or CompareValidator.
Nila Fridley
|
|
|
|
|
I have created a report generator that creates an XML and passes it back to the browser as an Excel Doc. It works fine but the application lives within https and seems to kill the application with this error:
Microsoft Internet Explorer
Internet Explorer cannot download DataGrid.aspx from www.mysite.com.
Internet Explorer was not able to open Internet site. The requested site is either unavailable or cannot be found. Please try again later. This creates the XML based off user selection etc.....
Report_Gen.aspx
<br />
Dim dataDirPathXML As String = Server.MapPath("..\DataGrids\XML\")<br />
ds.WriteXml(dataDirPathXML & Session.SessionID & ".xml", XmlWriteMode.WriteSchema) <br />
Response.Redirect("..\DataGrids\DataGrid.aspx") <br />
This passes the XML back as Excel.....
DataGrid.aspx
<br />
Dim temp As String = Server.MapPath("XML\") & Session.SessionID & ".xml"<br />
If System.IO.File.Exists(temp) Then<br />
Dim streamReader As New System.IO.StreamReader(temp)<br />
Dim sBuilder As New StringBuilder(streamReader.ReadToEnd)<br />
Dim stringWrite As New System.IO.StringWriter(sBuilder)<br />
Dim htmlWrite As New HtmlTextWriter(stringWrite)<br />
Response.Clear()<br />
Response.AddHeader("content-disposition", "attachment;filename=" & Session.SessionID & ".xls")<br />
Response.Charset = ""<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache)<br />
Response.ContentType = "application/vnd.xls"<br />
Placeholder1.RenderControl(htmlWrite)<br />
Response.Write(stringWrite.ToString())<br />
Response.End()<br />
End If<br />
I've been to the Server.MapPath("..\DataGrids\XML\") location and the xml is not being created.
What am I missing? I've tested this out-side the https and runs fine (local host or Live production server). Please any experiences with this kind of issue would be helpful.
|
|
|
|
|
+ Does the web page DataGrid.aspx support the https?
+ Does it work with the Server.Transfer method instead of the Redirect?
IMO, you don't need to redirect to a seperate web page as it only increases the round trip to the server, meanwhile you can put the code of the DataGrid.aspx in the Report_Gen.aspx which is accessible via https. If you want to reuse this code in multiple places, you simply wrap it up in a custom utility class.
|
|
|
|
|
Not sure what you mean
support the https And I've never used the Server.Transfer method. I'll do some reading on the Transfer to replace the redirect. Thanks!
|
|
|
|
|
Hi.. good day. I have a question, did anyone know how to display the date from database without the time. That's mean i have a textboxt in .aspx page, and i get the data from database n display it in textbox. Normally the date data will come with time. How to remove the time and only display out the date?Can anyone help me to solve the problem? Thanks...
Best Regards,
Pei Sun
|
|
|
|
|
textBox.text = myDate.ToShortDateString();
|
|
|
|
|
Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
Within the SQL you could format it there convert(varchar, dateFieldName, 1)
OR
cDate(dateVariable)
String.Format("0 ", dateVariable) , String.Format("0:mm/dd/yyyy", dateVariable)
Many diffent options.
|
|
|
|
|
Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
I have developed a Web application. There are two web forms in it.
I want these web forms to be deployed in a sub directory of the root
folder, because there are already some files located in the root folder
of the URL. I have created a sub folder in the root folder and copied all
the stuff from the project. When i try to access the specified Aspx file,
Some error occur, like "Configuration Error "
Sayed Muhamad Imran
|
|
|
|
|
|
Hi,
I have an eShop and there is a basket that runs showing the number of products purchased, total, etc. However when I add the the product to the "cart" it doesn't show the right product amount until I do a refresh.
The cart is a List(of Product) stored as a session variable.
I think it has something to do with caching but can't be sure. has anyone else had this problem and how does one fix it?
-- modified at 10:31 Wednesday 19th July, 2006
here is the trace
Begin Load 1.01957399613638 0.000019
BASKET LOADED 1.18213348344552 0.162559 <--- basket loads
aspx.page End Load 1.18221170567768 0.000078
aspx.page Begin ProcessPostData Second Try 1.18223237869618 0.000021
aspx.page End ProcessPostData Second Try 1.18226813743087 0.000036
aspx.page Begin Raise ChangedEvents 1.1822893691796 0.000021
aspx.page End Raise ChangedEvents 1.18230668981672 0.000017
aspx.page Begin Raise PostBackEvent 1.1823231723585 0.000016
WINE ADDED 1.21623949412565 0.033916 <--- wine is added to basket
aspx.page End Raise PostBackEvent
how do I get the event to call before the page load event?
|
|
|
|
|
Looks like you bind data to display before you udpate the cart. If this is the case, you simply refresh the display control by rebinding it to the updated cart.
|
|
|
|
|
no worries, I moved the code from the page_load event to the pre_render event which fired after the cart udate. thnk goodnes for the trace 
|
|
|
|
|
hi all
I am getting following error.
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for mymail@yahoo.com.
how to fix it.
thanks in advance,
regards
srinandan
|
|
|
|
|
You should the server on your host. Most email servers won't accept emails that come from outside their domains because of spammers, etc.
Either use the server where your site is hosted or check whether Yahoo allows you to send mail if you authenticate first.
|
|
|
|
|
thanks
but the problem is not only with yahoo.com it is with any website.
|
|
|
|
|
what email server are you using? i.e. what are you putting in as your smtp server to send emails from?
|
|
|
|
|
hai all...i am having a problem with ADS.I am developing a web application which logs in using ADS.I am not using the authentication anywhere else.
I need to show pictures present in a network folder in some other machine...but due to the security permissions in the network,i am not getting it displayed. help me....
Rameez Mohammed
India
|
|
|
|
|
Not the cleanest way to fix it but quick. Goto Folder within the Network, right-click and select properties, then the security tab and add Everyone to the folder with read-only writes. Without understanding the entire network this would be a quick fix.
|
|
|
|
|
Hi!
I am looking for a schedule control where I can allocate multiple tasks in one time slot.
So for example: the datagrid will have two columns:
1. Date and Time like 19/07/2006 13:00-13:30
2. Task 1(call Mr A) , Task2 (Call Mr B), Task 3(Call Mr C) and so on this should be dynamic and the time stored in database should be anytime between 13:00 - 13:30 which I will pick up from System.DatTime.Now
I have a schedule control, but it allows only 1 task per slot but I want multiple tasks per slot.I got this from this site : http://www.rekenwonder.com/aspnet/schedule.html
Can anybody help?
Thank you.
happy coding!
-- modified at 10:26 Wednesday 19th July, 2006
|
|
|
|
|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|
|
Posting the question once is enough
|
|
|
|
|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|
|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|