|
You may need to use delegates. Raise an event from the user control when button is clicked. The page has to handle the event and do necessary bindings.
|
|
|
|
|
Right, sticky little problem. I have a standard upload form in my web app, and I need to protect against people trying to upload massive files and getting crappy responses back. I'm catching the error in the Application_BeginRequest event by checking the inputStream, but here's my problem; If I do a response.Redirect to a URL with a meaningful error message, the application still won't display the page, as the massive HTMLStream is still there (at least I think that's what's happening. I've artificially triggered the redirect with a smaller file size, and it works, so it must be something to do with the size of the request).
I've tried using context.items.Clear(), but to no avail. also, a Server.transfer is not an option, because all the pages in the application inherit from a base page class that uses loads of session stuff, and server.transfer seems to lose all session information. So every way I turn I come up against a brick wall.
Does anybody have any ideas? If there was some way to do a server.transfer while preserving session state without preserving the input request stream, I think that would do it. But I can't see a way to do it.
Smokie, this is not 'Nam. This is bowling. There are rules.
|
|
|
|
|
You could run the upload-part (the source that is run when the button is clicked) in another tread. when you want to stop you could Kill the other thread and then do your server.transfer.
|
|
|
|
|
melchizidech wrote: I have a standard upload form in my web app, and I need to protect against people trying to upload massive files and getting crappy responses back. I'm catching the error in the Application_BeginRequest event by checking the inputStream
I am not getting why you chose application_beginrequest for this ? I guess you need to do the checking in the uploader form itself. Check the FileUpload1.PostedFile.ContentLength property to check for files.
|
|
|
|
|
i have used a datalist control and data bounded.in that i have used
asp:Literal to display text.the width of datalist 730px and cant more width. When i showing data in literal control it doesn't show all text.i want to show all text in that control. are their any ways/tips to display all my text in one controls.
|
|
|
|
|
hi,
you better use an HTML DIV tag inside your literal text value and set it's overflow mode to scroll. then it'll show the data in a scrollable manner.
e.g.
assign the control from datagrid to a local variable(object in this case) ans then set its value to your text keeping that text inside DIV tag
label1.text="<div id='oDiv' style='width: 200px; height: 200px; overflow: auto;'>" + "YOUR TEXT HERE" + "</div>"
Regards,
Ashish Sehajpal
|
|
|
|
|
I have to create a MS - Word document with header and footer from a HTML string. I am using the below code.
Dim strHTML As String = "<html><body><br><b>hello</b><br></body></html>"
Response.Cache.SetExpires(DateTime.Now.AddSeconds(1))
Response.Clear()
Response.AppendHeader("content-disposition", "attachment;filename=FileName.doc")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.ms-word"
Me.EnableViewState = False
Response.Write("\r\n")
Response.Write(HttpUtility.HtmlDecode(strHTML))
Response.End()
I want to build the HTML with header and footer which will be later converted into a MS Word with Header and Footer also if the pages got increased.
Please help me out.
|
|
|
|
|
Hi All.
I am working on asp.net project where my company already two different domain
1.auds.aud.edu for (student)
2.auda.aud.edu for (staff)
my system is in auda.aud.edu domain.
all user details are in active directory and we have two different active directory for auda and auds domain
my local pc is connected to auda domain and my projecte running under vs2005 with windows xp pro.
i am authenticating users using active directory .its working fine it only authenticating LDAP://auda.aud.edu users becs my PC is under auda domain.how can i connect to auds.aud.edu domain if i give the ldap path like LDAP://auds.aud.edu or LDAP://<servername>/DC=auds,DC=aud,DC=edu all i tried not working i am able to ping the <servername> from my mechine but i cannot access the active directory users from my PC
pls help how can i solve this
|
|
|
|
|
in template columns i can use the container.dataitemindex + 1,
if i have to use the bound fields , and in the first column , i have to make it an autogenerate column, for serial no , how should i do that ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
What dou you mean by Autogenerate column? You mean you need to fill up a ColumnHeader with "Serial no" as text, which can be set by the HeaderText proerty of a databound field ?
|
|
|
|
|
hi,
currently i m using ASP.NET with C# (.net 2005, 2.0 framework).
here currently i m trying to backup of my project.
when i copy my project and paste in another location, the changes are affecting the
backup also.
how to rectify it? - KARAN
modified on Tuesday, April 1, 2008 1:46 AM
|
|
|
|
|
It may not be affeting your back up how ever your solution file may be still pointing to the original one.. Is that the case ?
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
|
Hi anybody know about downloading folder??
i have a code for downloading file.but i need code for downloading folder.
im using asp.net2.0 with c#
Nothing is Impossible. Keep always Smiling...
|
|
|
|
|
Only 1 file can be downloaded at a time, so you can't download a whole folder of files in 1 go.
You could zip your files into a single archive and make that available for download though.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
ok please tell me how to zip and download a content.....
Nothing is Impossible. Keep always Smiling...
|
|
|
|
|
You can use the the J# libraries for that
You have a class called
java.util.zip which you can use to do the same..Just search ont he same
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
|
hai, i m using ASP.NET with C# (.net 2005, 2.0 framework).
when user press the BACKSPACE key or ALT+LEFT ARROW, it should not goto the previous page.
how to proceed this? help me - KARAN
modified on Tuesday, April 1, 2008 1:47 AM
|
|
|
|
|
You can never do that. They are client side events.
|
|
|
|
|
How to create Pdf in windows application? Please Help me
thanku
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
The best advice I can give you is to post in the right forum. This forum is for ASP.NET questions.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
NO BOdy in that forum so i post Here My Dear...........
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
|
Answer:
Dim Filename As String = Application.StartupPath + "\Export.pdf"
Dim _SaveFileDialog As New SaveFileDialog
_SaveFileDialog.Filter = "Apache Files (.pdf)|.pdf"
'sss.Filter = "HTML Files (.htm)|.htm|" + _
' "Active Server Pages (.asp)|.asp|" + _
' "Apache Files (.pdf)|.pdf|" + _
' "Perl Script (.pl)|.pl|" + _
' "All Files|"
_SaveFileDialog.ShowDialog()
Filename = _SaveFileDialog.FileName
If Windows.Forms.DialogResult.Yes Then
Dim myDoc As New Document()
PdfWriter.GetInstance(myDoc, New FileStream(Filename, FileMode.Create))
myDoc.Open()
myDoc.Add(New Paragraph(" "))
myDoc.Add(New Paragraph("User Responses are as Follows:"))
myDoc.Close()
End If
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|