whats this..? Dim strimage As String = "~/SchoolFeeCollection_lalit1/Photos/JC001924.jpg" '"~/Photos/" & photo
the easy way to find the path is to ..!
drop an image control and go to properties set the image url to the image which is stored in the folder..!and copy the path from the source which will generate by VS..!
Why Do Some People Forget To Mark as Answer .If It Helps.
I might be missing something blindingly obvious here but you don't need to call Server.MapPath when setting an image url. Server.MapPath will give you the physical location on the server disk which is useless when the web page is sent to the client.
I've a website that allows a user to create and download a document. I first save the file in the server and then let the user download it. This works just fine. But when multiple users try to do this, they must create their own copy of the file in the server. Can somebody suggest a foolproof way of naming the file - so that everyuser downloads only their copy of the file.
Of course.. Pad the UniqueID(Preferably a GUID) just after the actual filename. It will identify which users copy of the file it is.
Also, if your requirement is only to have a copy, why dont you use Database as file storage. It is easier to manage files in database as far as your reqirement is concerned. Only a single row with UserID Foreign key will do the job for you.
Also, another thing, if the file wouldn't be modified by each user in the server, you dont have to store multiple copies of each file.
To Resolve this you can have a Small Function that will check if the File Exists , if so tell the user else create the File. Let the user be in control of the naming. This will make things easier for them because they will remember the names. Just add a Control Mechanism to check if the File exists with that name, if it exist Suggest another name.
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
on clicking a button i am getting a following error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true"
%> in a page. For security purposes,
this feature verifies that arguments to postback or
callback events originate from the server control that
originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.
protected override PageStatePersister PageStatePersister
if (_pers == null)
_pers = new SessionPageStatePersister(this);
Everything works great, the viewstate is no longer on the page and is moved to session. But how does this get released from the session. I don't see it released and my servers cpu memory is growing indefinetely.
Who told you that using SessionPageStatePersister is a better technique to hold page data.
I think it is better to have viewstate in hiddenfield using HiddenFieldPageStatePersister which is default. I think Everyone here will accept this(Even microsoft do think this, thats why they placed it as Default)
Using excessive session is not a good idea. Actually Session is cleared only when Session TimeOuts, or you manually clear the Session during Logout Request / or anywhere. PageStateAdapter can just refresh the Session Page state on every request.
Dont load lots of Data in one single Application Pool. This will endanger your site if large no of request is made to the site.
If possible, try to minimize the Viewstates transferred to the page.