|
any more detail will help - please try handling on error event @ global.asax...
|
|
|
|
|
You can use the MaxRequestLength[^] in the web.config to limit uploads. It can be discussed how friendly it is to the user.
But one of the problems with the contentlength is that it's not always present.
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
How are you getting the file? Something like...
Request.Files[0];
If so you can try something like...
if(Request.Files[0] != null && Request.Files[0].InputStream.Length > 1048576)
{
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thanks to you and the others for the feedback
i discovered the problem is the web server itself having an issue with the uploaded filesize and causing an exception before i even get chance to test and handle it
i had to allow larger uploads and screen for a maxsize before processing but still if a user tries to upload a file bigger than the max i allowed it will cause an exception
not very good design imho
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Your right, that doesn't sound such a good design. thou I guess there needs to be a way to prevent stupid file sizes by default in case people forget to check within program
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
I'm creating a dynamic table and checkboxes at Button_Click event.
The user need to choose some of them and after words press ather button,
my problem is at the post back, how i can show the same dynamic checkboxes with the checked ones.
I tyied to use ViewState, but it's duplicate me the table.
Please help.
10x
|
|
|
|
|
either change your logic to create them at page init or read data at post back and write it back after binding.
|
|
|
|
|
Amar Chaudhary wrote: either change your logic to create them at page init
It works.
10x
|
|
|
|
|
is there key press event on asp.net ? (like in winform) ?
for example when i press enter or Esc on textbox control ?
thank's in advance
|
|
|
|
|
Yes, but you are really thinking of Javascript here. You can attach events to DOM elements, and the textbox supports the onkeypress event.
|
|
|
|
|
yes there is -
To do the same I will recommend you to use JS.
If for some reason you have to do it on server - highly unrecommended - you can turn auto post back on.
If there is something very critical and you need server at all costs then please try using webservices.
|
|
|
|
|
Hi,
In my application I am having a gridview on a page, I want its data to be loaded again only if there is any change at database end in spite of loading same data again and again.
|
|
|
|
|
for that, you have to your own mechanism. You can use cache to store the data and make the dependency on that, so whenever the data will be changed your Cache need to be reloaded, you can do this via callback. For details, have a look
Exploring Caching in ASP.NET
Now once you have new data then you can reload the grid.
|
|
|
|
|
hi
i have C# Winform program and i need to convert it to Webform.
can i get any simple sample for how to show database grid on screen,
add new, update and delete ?
i try to show table on screen like this:
SQL = "SELECT * FROM MEN order by Lname";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"].DefaultView;
but i dont see nothing
|
|
|
|
|
After doing this you also need to call
GridView1.DataBind();
|
|
|
|
|
Gali1978 wrote: i dont see nothing
So what do you see then?
|
|
|
|
|
|
I have a datatable with around 6000 rows and 8 columns. Out of these, I want to extract all the 6000 rows but only 3 or 4 columns. Looping trhough row is not possible. How can i extract only the columns along with the rows to a new datatable? Please help.
Is it possible using LINQ? I am using .Net 3.5.
Thanks,
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
OK, I'll bite, why do you need it in a new DataTable?
Rhys
"I'd rather die on my feet than live on my knees"
|
|
|
|
|
Why because, the requirement is that, the column name should be the name from the database which user entered through UI (User friendly column Names). And one column will be mapped to multiple columns, means column A in datatable 1 will be named as 'TestColumn1' and 'TestColumn2' even though the column values are exactly same. Also, only require 3 or 4 columns out of 8 or 10.
So I can keep the existing table intact and copy only the required columns to new datatable and change the name.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
Hi,
In my asp.net 2.0 web application, I have an aspx page from where I am opening an HTML window with javascript:window.open(url,etc,..). The HTML page contains a flash component and a HTML button control . What I want to do is, on the click event of the button control in the HTML page, the HTML page should close and the aspx page (which is still open) to get refreshed.
Can someone suggest me way?
Thanks in advance,
GeoNav
|
|
|
|
|
I think this can be done easily.You should call the following javascript function on HTML page
function CloseandRefreshParent()
{
window.opener.RefereshPresentPage();
window.close();
}
and have the following function on your aspx page
function RefereshPresentPage()
{
window.location.href = window.location.href;
}
Now as you can see from the code,
first function calls the method RefereshPresentPage of the parent page, which actually refreshes that parent page and window.close() actually closing the current window.
Let me know if you face any issue
|
|
|
|
|
Hi,
Thanks. It works like a charm........
But i notice that other control, such as text boxes and comboboxes, have their values set to default values..... It is important to retail their values, since I am using script on a biodata form......
Thanks,
GeoNav
|
|
|
|
|
Hey,
I found a solution by using the Java script 'window.showModalDialog(url); window.document.images['imageControlName'].src='imagePath';'
This opens a page in modal window and when I close this window, the image control in parent page gets refreshed. Other controls are not affected.
Thank you so much for your help.
GeoNav
|
|
|
|