|
Dont repost.I did give u solution.
declare namespance "System.IO"
try this.It return content of .txt file
File.ReadAllText(Server.MapPath("content.txt"));
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
|
I'm using the in-build login feature for my web sites login with roles
Roles:Staff,Manager
I would like to know how to set the login so that when the staff logs in
he/she is directed to staff page instantly this also has to be the same for
the manager
|
|
|
|
|
duo!@# wrote: in-build login feature
Don't know what is that are you saying about built in login control ?
Any way for that if you have home page then in home page check the credetials for the logged in user according to that make server.transfer to respective page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
What i meant by build in login control, instead of having a code based login which validates from the database. You get to pick up login controls from the toolbox and use the asp.net config to set roles and users.
To make it short an easier way of creating logins.
|
|
|
|
|
Please specify the environment requirements with any specific service packs.
|
|
|
|
|
I'm using a roles based website
This website uses a master page
The Roles:Staff,Manager
the roles are to make sure the staff cannot access the mangers page OK!
Now the Problem
i managed to get the master page looking nice, using images as div tags background.
For the roles based login to work it has to placed within a folder in the solution explorer.
I'm coming close to the problem.
Those neat div tags images go missing when i view the pages in the folder for staff and manager. It totally
|
|
|
|
|
Sounds like your master page is using relative paths, which then become relative to the subfolder your staff pages are in. Use absolute paths.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have a subfolder in my application with different file (doc, avi).
all files are accessible only when the user is authenticated in the application but i want to secure for direct access from url.
exemple : www.website.com/file/document.doc can't been donwloaded directly. the user must been authenticate to access to this file.
How i can do this?
ty
|
|
|
|
|
What kinda authentication are you using in your application?
If you are using integrated-window authentication then you can specify the specific permission or users to that folder.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
i use form authenthication in web.config:
User is stored in database.
How to do integrated-window authentication?
ty
|
|
|
|
|
If you wanna use integrated-window authentication, you have to create the user account on Active Directory Service of Window Server. then, you can set the permission on the folder.. and you need to disable the anonymous access for your website.. so, if someone is trying to access your website, it will show the login dialog to authenticate the user.
it is very easy to do in intranet site but if the website is on public server then you need to have dedicated hosting or something that can give the active directory service.... but it cost a lot of money...
maybe. HttpModule as N a v a n e e t h suggest might be good for you..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
ok but i try to do integrated-window authentication without Active Directory Service.
|
|
|
|
|
I don't think it can be done without using AD..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
jerome_data wrote: exemple : www.website.com/file/document.doc can't been donwloaded directly. the user must been authenticate to access to this file.
You can take the advantage of using HTTPModule. Write a HTTPModule and check all the request's. If any request comes for protected file types, check authentication, if not authenticated rewrite the URL to authentication page.
|
|
|
|
|
how do you do to protected file (other than aspx file of course) in subfolder?
|
|
|
|
|
jerome_data wrote: how do you do to protected file (other than aspx file of course) in subfolder?
Same way as I explained in the previous post. I reiterate
You have to write a HTTPModule and attach it with your website. HTTPModule is having set of events. You can use PrequestHandlerExecute event. This event fire's for all requests.
Assume you are getting a request like www.yourdomain.com/subfolder/file.doc which is a protected file. So first your HTTPModule will be invoked. In that check like
private void PreRequestHandlerExecute(Object source,EventArgs e)
{
HttpApplication CurrentApp = (HttpApplication)source;
if ( CurrentApp.Request.Url.AbsoluteUrl.EndsWith(".doc")
{
}
}
To get your HTTPModule working with other extensions than ASPX, map the extensions you want to process to aspnet_isapi.dll in IIS.
|
|
|
|
|
|
I have a Grid View. Here I have a column "Active". I attached this GridView to objectDataSource. In database this field has true or false value.(1 or 0). But in Grid View I want to show that if this field has value 1 in database the value for this column should show "Yes" but if the value of this field is 0 in data base the The GridView should show "No".
How can I do that.
seema
|
|
|
|
|
The most obvious way would be to write your data layer to return what you want to show. Otherwise, you need to write a custom column definition which takes the input and shows the text you want.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can I create the Custom Column and display the text that if it is 1 then show "Yes" or if it is 0 show "No"
seema
|
|
|
|
|
Which bit are you stuck with ? Naturally, you need to define the columns yourself and turn off the auto creation of columns based on table column names. Then, you define a column which checks if the value is true or false, and emits the right string.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using Visual Studio 2002 for learning. I am interested to learn Web forms in Dot Net. I have written objects using Vb.Net in Asp.Net projects. I am facing problem when the objects do not retain value assigned when post back occurs and accross methods written in the code behind page for asp.net page. My friends told me to put object in viewstate or session state. That worked. However, I am not happy. I have observed no such method is used for built objects of Dot Net Class library eg. datagrids, labels, text boxes, drop downs etc. What method they are using to conserve values during post backs I do not know. I know an efficient way of handling objects and values throughout post backs and efficient way of passing objects to another aspx page from within an aspx page during run time.
Kindly help me with sample code and little guidelines.
Thanks,
satishitagi@yahoo.com
satishitagi@yahoo.com
|
|
|
|
|
ASP.NET server controls do use the viewstate to persist their values. Try setting EnableViewState="false" at either page level or object level and you'll see....
Fred
|
|
|
|
|
itagi wrote: passing objects to another aspx page from within an aspx page during run time.
In 2002 the only way to do that is the URL or the session.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|