|
I have built a login authentication section that uses forms authentication. The administrator can log in with their password and username and are granted access to admin pages. However...I dont want a login page as normal users of the site are not monitored. I would like another method so that when the admin is browsing the site the admin pages are made avaliable. Maybe using a cookie or IP address or something. HELP!
cheers
|
|
|
|
|
I use both cookie and session.
Glad to discuss with you and best wishes.
|
|
|
|
|
Hi all
(ASP.NET)
I would like to allow a logged in administrator to upload files to my web application for download.
1) select file for upload
2) upload file
3) web app displays download link for file
Is the best way to do this using a database table "files" or a folder containg uploaded files? Any suggestions welcome plus code examples?
cheers
|
|
|
|
|
I prefer to store files in a folder. and store file path in a table.
Glad to discuss with you and best wishes.
|
|
|
|
|
When you upload the file you can add file name with its path in the database. When the user go on the file listing you can easily display the file as a link from the database. I usually don't save files in the database until and unless I am very sure about their size and when its a requirement.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
In my page, the visitor will fill in a form and can upload a file.
I do not need to save the file itself to the database, rather I save the file to a folder on the server with a reference in my table.
The Problem is:
if more than one file with the same name and extension were uploaded, each one will overwrite the older one
I have 2 solutions of my own:
1- I can create a sub-folder with a name same as the primary key of the record this file belongs to. and upload the file to that sub-folder
2- I can append the primary key as a prefex to the file name
But, I think this problem has more smart solution that I faild to find by google or even in codeproject articles
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
|
What solutions you have suggested are good you can also do one more thing is to rename the file either with the primary key or some GUID name and keep the actual file name and path of the file in the database so that when you display the file you can show it with actual name and on the backend its with some different unique name.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
Thanks
But I gussed there is more standarad direct solution
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
To be more honest I have not seen any better solution so far as the above 3 solutions. any way there still can be a better way but I couldn't find any thing wrong in this one.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
farazsk11 wrote: but I couldn't find any thing wrong in this one.
One of the lacks of the above 3 solutions is that them all depend on the primarykey.
And I generate the primarykey on the submit event (for some reason)
So, how to use it in the upload event before it is generated
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Well as a matter of fact I usually use GUID to rename files and as the GUID is generated in the code I pass it in the database. I usually store the GUID name and the actual name so that when the user request I can display it as actual name and on the backend i keep it with GUID.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
I have a problem with using div in master page with a fixed CSS file. The div contains content panel. The content panel has a grid view or a data view or both. When they appear in the page, they go out of the page.
I tried to make the height = inhernt and also height = auto, but both of them didn't work.
How can I make the page expand to contain them/it as long as they expand?
Regards,
modified on Sunday, March 30, 2008 5:24 AM
|
|
|
|
|
try not to give any property of height in the css file.
|
|
|
|
|
I am not using CSS file. I am using inline code.
|
|
|
|
|
You might want to try giving your DIV the CSS attribute of overflow:auto; .
I hope this helps.
|
|
|
|
|
Can someone tell me please how can I change the location of a div when a page loads?
I need to change the location on the page of the div. I tried to use java script but i couldn't manage. Thanks infront
|
|
|
|
|
Does your DIV have an ID attribute? If so, if you want to move it using JavaScript, you could put the following code in the BODY section of the web page. Or, if you wanted to have the JavaScript in the HEAD section, you could turn the code into a function and have it called in the OnLoad event of the page.
<br />
<script type="text/javascript"><br />
myDiv = document.getElementById("theDivID");<br />
myDiv.style.left = fillIn+ "px";<br />
myDiv.style.top = fillIn+ "px";<br />
</script>
(Note, replace both fillIn with integers and theDivID is the actual ID of the div)
I hope this helps.
modified on Sunday, March 30, 2008 3:59 AM
|
|
|
|
|
And how can i call a function in the onload of the page code and pass the variables?. i tried various ways but with no results. I am still a beginner in javascript so i m new to its funcitonality
|
|
|
|
|
Where are you getting the new left and top values for the DIV tag? (Eg, inside of the ASP.Net page's code, or through JavaScript?)
If you are getting the values through ASP code, you won't have to use any JavaScript; just add the runat="server" attribute into the DIV tag and change the Left and Top values through your ASP code.
I hope this helps.
|
|
|
|
|
I am getting the values thorugh code. How can I pass them through ASP code. I tried to do the following but with no success.
*runner is the name of the div
runner.Style.Add("left", xpos.ToString());
Thanks for your help
|
|
|
|
|
I think the code that you will want to use is:
runner.Style.Item("left") = xpos.ToString() + "px";
Note: The code that I have given you might not compile correctly; I haven't done a lot of work in C#.
Also, in your CSS code for the DIV, have you set it's position attribute to absolute?
position:absolute;
I hope this helps.
|
|
|
|
|
My webhost specification say that they have support for both Asp.net-mssql and php-mysql. I have designed the pages in Asp.net and now I want to have a blog in it. Can I use Wordpress in the middle of an Asp.net site? just by giving a "link" the Php blog page? will that work?
Thanks.
|
|
|
|
|
Yes, yes it will. (PS, ask PHP questions in Web Dev)
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Is any reporting tool other than crystal report. in asp.net 1.0 or asp.net 2.0
Thanks!
|
|
|
|