|
Hi..
I m working on a web application where I have simple structure.
I have root directory and a secure directory.
root directory have pages which all users can request, and secure directory will be accessible to users who are authenticated. ( I dont need roles as i will have only one type of users)..
can you tell me how to proceed for authentication..
thanks,
By:
Hemant Thaker
|
|
|
|
|
There are several different ways to accomplish this; what have you tried so far?
If your users have to log in you should be able to create some logic which tests for that and redirects or allows through as appropriate. How are you managing the users?
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Hi.. thanks,
I am storing users in database. only username and pwd.
Once user is logged in certain links will appear ( links for secured pages).
so I want , only valid users can request these pages..
I simply want to stop someone directly using Urls in address bar for these secured pages..
thanks,
By:
Hemant Thaker
|
|
|
|
|
One way would be to create an attribute that would test to see if the current user is logged in/valid. If not, then redirect to another page. You would create the attribute and then decorate the page class; see the tutorial or fond one more suitable.
Attributes Tutorial[^]
This is just one way and it may not be the best for you (or anyone, for that matter). Do some more research and see what else you can come up with on your own, try it and then come back when you get really stuck.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Hi.
I am storing username to a session["userid"] variable, once the user logged in.
How about checking the session value on the page_load of all secured pages.
and if dont find the value redirect to "custom_page"
thanks
By:
Hemant Thaker
|
|
|
|
|
if (Session["userid"] != null)
{
}
else
{
}
Raju.M
|
|
|
|
|
Let an attribute do that for you - that's what they are there for! Read the docs and i should get you started.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
hello,
my name is ankur sharma.
I want to create a fusion chart from xml and want to show in swf format using asp.net.
how to achieve it.
Plz guide me
Thanks
|
|
|
|
|
You need to read following guide for creating xml file
from your data.
Fusion Charts[^]
Give this xml file/string to the fusion chart function to generate
and render the charts. The guide will help you to do so.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
hi iam using asp.net with c#
in my application when user login successfully,then in the next page based on the client database i have to display data in a grid view ,
so how to give connection string in asp.net with c#
can you correct my code which helps me
protected void Page_Load(object sender, EventArgs e)
{
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
string strcon = "Data Source=";
strcon += clientIPAddress+";" + "Initial Catalog=POS;Trusted_connection=true";
SqlConnection con = new SqlConnection(strcon);
SqlCommand cmd = new SqlCommand("select * from AllTransactions where BranchKey=" + Convert.ToInt32(Session["BranchKey"]) + "", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "tt");
GridView1.DataSource = ds.Tables["tt"];
GridView1.DataBind();
}
the data is displaying in my system but when client logins it is showing no record, can you correct my code
|
|
|
|
|
I am not able to understand why and how
you need to access client side database.
But for getting client IP
Use this..
Request.ServerVariables("REMOTE_ADDR")
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
hi to all,
i have added texbox dynamically which is located at modalpopup i want to do validation for that textbox how can i do that//
plz tell me...
thanks
|
|
|
|
|
|
Hi
How to send sms to any mobile no. by web application in asp.net on click of button and automatically on particular date.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Look here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
|
I'm getting a weird error. I have a css class and I dragged the reference onto the aspx.
The compile-time page is recognizing the reference to the styles in the css because when I remove the css reference from the aspx the page displays squiggly lines under the CssClass references with a tooltip "cannot be found".
However, when I run the page the css classes aren't getting applied.
Also weird - when I copy the css class definitions from the css file into a tag in the <head> variable of my page the css classes DO get applied.
I can't figure out why my css classes aren't getting applied at runtime even though the references appear to check out at compile time. Any ideas?
|
|
|
|
|
Have you checked the url of css file in the generated page source. It seems to me that the path of the css file is incorrect.
Try using ResolveClientUrl to set the css url.
<%=ResolveClientUrl("~/css/default.css")%>
WWW, WCF, WWF, WPF, WFC .... WTF
|
|
|
|
|
Member 3919049 wrote: I can't figure out why my css classes aren't getting applied at runtime even though the references appear to check out at compile time.
At times, it happen that it is fine during compile time but when you publish it, the path is little different and thus you code is unable to refer it. Looks like the same with you.
Using viewsource of page, check where is the stylesheet being referred. Is the location correct based on your project hierarchy.
If you are unable to resolve the path in deisgner, you can check the value of it on server side, using the same URL.
You can also, set the URL of CSS via codebehind. Refer: Resolving Paths in a Multi-Folder WebSite[^]
|
|
|
|
|
Hi,
Have you ever tried to refresh the page , sometimes the css + js files are cached, Ctrl + F5 could help
i faced this issue when trying to add new css classes to the stylesheet file and fixed it by refreshing the page
Regards,
Jamil
|
|
|
|
|
I am working with a page which needs to change it's language by user decission, so I created the Local Resources and I want link the language to an imageButton with the country flag, and I change the Culture data inside the button click event and overrides the InitializeCulture Method, and it works, but because InitilizeCulture executes before than the click event it needs two clicks for getting the page change, my InitializeCulture method contains the following sentences:
protected override void InitializeCulture()
{
if (Session["Cultura"] != null)
{
Cultura = (string)Session["Cultura"];
UICulture = Cultura;
if (Cultura == "es") Culture = "es-ES";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Cultura);
}
base.InitializeCulture();
}
What I need to introduce in order to avoid the double click, because the execution order normally is InitializeCulture - Page_Load - Button_click, and if I directly call the InitializeCulture from the Button_Click it doesn't refresh th screen.
Best Regards
|
|
|
|
|
A simple hack would be to redirect back to the same page in the click handler.
|
|
|
|