|
Hi,
I have an asp.net web forms project. No master pages, no ajax, I have a file upload control and when I fire postback the HasFiles property is always empty. I started a new asp.net project. Copy/Pasted the code into it and it worked. HasFiles was retained. Does anyone know why? The code:
<table>
<tr>
<td>
<asp:FileUpload runat="server" ID="flImage" Width="400px" EnableViewState="True"/>
</td>
</tr>
protected void Page_Init(object sender, EventArgs e)
{
if(IsPostBack) return;
}
protected void Page_Load(object sender, EventArgs e)
{
if(flImage.HasFile){
Application["FileBytes"] = flImage.FileBytes;
Application["FileContent"] = flImage.FileContent;
Application["FileName"] = flImage.FileName;
Application["PostedFile"] = flImage.PostedFile;
}
HasFile is always false.
modified 14-Aug-13 10:35am.
|
|
|
|
|
Whoops! Looks like you've broken the forum.
Please edit your post and either remove or HTML-encode the <table> and other HTML tags in your question. The quickest option is to select the entire block of code and click the "code" button in the editor toolbar.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You may want to edit your post, it has caused some weird behaviour in its formatting. Try putting your code between <pre> tags to see if that fixes it.
Use the best guess
|
|
|
|
|
Move your code from Page_Load to the Click event handler of the submit button, remove the EnableViewState property, and try again. Not sure if that's the reason, at least, it works in my projects.
|
|
|
|
|
hello pls try this circumstances
1 >> check that if you have updatepanel then you have applied trigger on that one
2 >> check that your page load have !isnotpostback and if yes then in that file upload is not getting null
this should be issues may be
regards...
|
|
|
|
|
Hi,
I have a datatable need to seperate or copy only duplicate record from that datatable to new datatable.
Ex
Input Table
Name ID
Ram 1
Raj 1
Vion 2
Result Table
Name ID
Ram 1
Raj 1
Please help to resolve this situation. Thanks in Advance!!!
|
|
|
|
|
Something like this should work:
static DataTable GetDuplicateRows(DataTable source, DataColumn id)
{
var rows = source.Rows.Cast<DataRow>()
.GroupBy(row => row[id])
.Where(rowGroup => rowGroup.Count() > 1)
.SelectMany(rowGroup => rowGroup)
.Select(row => row.ItemArray)
.ToList();
var result = source.Clone();
result.BeginLoadData();
rows.ForEach(values => result.Rows.Add(values));
result.EndLoadData();
return result;
}
DataTable source = ...;
DataTable duplicateRows = GetDuplicateRows(source, source.Columns["ID"]);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hi
i have created web application in asp.net and i am able to clear session using Session.Abandon() in Logout.aspx. It is working for IE and not working in Chrome browser. After logout again if i click back button of browser, it is going back. How to clear session and cache of chrome browser in asp.net.
If anybody knows, please reply me.
thanks in advance.
|
|
|
|
|
|
Hi,
I have a mysql database which is using for website also. How can i make connection to this database from dxtreme(In which js and html5 are using to develop mobile apps) ? And Is it possible to connect to this database and select tables, columns from it and display some contents in dxtreme views (html page)? This is my connection format which i am using for website " "
I am using vb.net and visual studio for website. Database and website is hosted in a server.
Thanks in Advance
|
|
|
|
|
I am thinking of purchasing a server to help me learn ASP.NET, ASP.NET MVC & SQL Server 2012 database programming (triggers, stored procedures, etc.). My goal is to learn true 3-tier development and database-centric web development. I am now in a C# certificate program.
My question is basically, can I accomplish all my goals with my PC? Would a server be an aid or merely complicate my life unnecessarily?
Thank you,
Jazz Engineer Steve
|
|
|
|
|
To learn this stuff a server is not needed. You should install software on your own pc. If you really wanted to have a client server relationship you could spin up a virtual machine on your dev box. You will need good RAM but would be cheaper than server.
Added to that, If you wanted to look at servers, Azure cloud hosting would be a very cost effective solution!!
|
|
|
|
|
db7
Thanks for your initial reply. My PC max's out @ 8GB of RAM. Is that enough for SQL Server, ASP.NET & Visual Studio 2012?
|
|
|
|
|
This is fine. SQL server generally tries to obtain as much memory as possible but this is not an issue for small scale development. If you really are concerned by memory etc, I would look at creating a VM and hosting your server on that. You can use a great product from Oracle no less.
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html?ssSourceSiteId=ocomen[^]
install the software and load an image onto your pc. It is great because you set the memory, cpu and disk so if your sql server was on the vm and you limited the vm to 2gb, you never use any more than that.
Anyway, your pc seems more than capable for this. I have (unfortunately) worked on lesser memory than yours so it should be fine!!!
Just go ahead and install. If the performance is a real pain, re-think and uninstall or turn of the services... either way, there is no harm in playing! 
|
|
|
|
|
You can also try virtualization, e.g. with VMWare Player. That allows you to play with your "server": you can copy early versions, then just try this or that step, and in case of failure return to the original version.
Any modern computer should be strong enough for that purpose (I have a quadcore with 8GB RAM).
|
|
|
|
|
I have a webpage with two buttons Save & Close, Save & Add Next Question.
How can I call different functions for each of the buttons above.
|
|
|
|
|
civic060 wrote: I have a webpage with two buttons Save & Close, Save & Add Next Question.
What are those buttons? just input buttons or submit buttons?
<input type='button' />
<input type='submit' />
civic060 wrote: How can I call different functions for each of the buttons above.
Did you mean action methods on the controller or AJAX calls through JQuery/Javascript?
Regards,
John
|
|
|
|
|
|
|
WHAT IS THE USE OF VALIDATION , CAN WE EXECUTE A PROGRAM WITHOUT USING VALIDATION
|
|
|
|
|
DON'T SHOUT!
Typing with the caps-lock key on is considered very rude.
Start by reading this:
Walkthrough: Validating User Input in a Web Forms Page[^]
If you want to turn off validation for a particular control, you need to use the CausesValidation[^] property.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
good link 
|
|
|
|
|
the Jquery is not compiling...
var divContainer = $("");
showing copile error near "display" in above line
|
|
|
|
|
On the bottom of the article's page, you'll find a "Comments and Discussions" section. Please ask your question there (normally, the author of the article will receive an email that a question/comment has been posted to his article).
|
|
|
|
|
I had created an exe file and currently using it and i had built an update version of same exe file and uploded on my website ... Now if i open the application it should as pop-up as update version were avialable ??? can any one guide me with any example...??
|
|
|
|