|
I didn't say it was. What is your problem? You're not right: it isn't the only answer and I already said that custom wasn't either.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
What the hell is your problem? You start off with "That does not suit every occasion - it is wrong to tell people that."
That was a very offensive attitude to begin an open discussion with.
Followed up with "Your're not right" shows a lack of respect for other viewpoints and the people who present them.
There is no right or wrong, we have choices. I stand by my comments that in this case the OP should not be creating a mechanism that already exists. You can disagree, but you don't have to be disagreable. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: That does not suit every occasion - it is wrong to tell people that."
You found that offensive? Grow up: I thought that fairly polite. Take it howver you want, I suppose.
Mark Nischalke wrote: I stand by my comments that in this case the OP should not be creating a mechanism that already exists
Rubbish. There is always more than one way to skin a cat and just because MS give you something for free doesn't mean you have to use it.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Mark Nischalke wrote: You can disagree, but you don't have to be disagreable.
Good advice - take it.Jon
"I don't think the human race will survive the next thousand years, unless we spread into space. There are too many accidents that can befall life on a single planet. But I'm an optimist. We will reach out to the stars." ~ Stephen Hawking,
Soap Box 1.0: the first, the original, reborn troll-less
|
|
|
|
|
If everything you do is custom then I might use Attributes to decorate the master page, if you have one, or every page other than the login page if you don't that just does:
1: Is this user logged in? (Could be accomplished by populating a session variable upon successful login).
2: Yes: allow access to any page. (You could also have stored the selected page in a session variable).
3: No: redirect to login.
Attributes are fairly simple to create so you can look that bit up: I'm sure there are plenty of articles on CP that will help.
I'm also sure there are other ways to do this and perhaps someone else can offer further suggestions.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Thanks for this idea. It never came to my mind to store the selected page in a Session variable. I will do it and feedback you ASAP.
I am grateful.
|
|
|
|
|
Wow, I tried it but not getting it right.
I declared a Session("selectedPage") = "~/page.aspx" variable under the Page_Init event of the page.aspx page.
Under my masterpage, I checked :
If ((Session("selectedPage").ToString() <> "")) Then
Response.Redirect(Session("selectedPage").ToString())
Else
Response.Redirect("~/anotherPage.aspx")
End If
but I as redirected to the anotherPage.aspx after succesfull login which I started by selecting the page.aspx as my startup page.
What could have happened plz?
|
|
|
|
|
Okay@ let's pretend you have a site with a Master Page, Default.aspx, Links.aspx, Contacts.aspx and Login.aspx.
The only 2 pages that anyone can see without some form of authentication are Default and Login. If they try to access any other page they get redirected to LOgin if the Session variable that tracks their status is empty. If you create an attribute that checks for their status and redirects accordingly from the Master Page that should help to solve your issue. What you will also have to do is to, for example, maybe have some code underlying a menu click option that tracks the page they were trying to get to and pass that into the session variable.
See how you get on: I think you should be able to figure out the rest of it from here.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Thanks a lot. but I don't seem to understand what and how to imlement that attribute you are saying. Do you mean a property?
|
|
|
|
|
I think you need to start figuring some of this out for yourself: there is a lot of information about attributes all over the web and especially within Code Project..Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
As I've been trying to point out if you use the built-in mechanism all of this is handled for you, plus other benefits. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Step 1) When you redirect user to the Login page (i.e. Login.aspx) pass the current url in Query string.
i.e.
Response.Redirect("Login.aspx?PreviousPage=" + Request.AppRelativeCurrentExecutionFilePath.ToString());
Step 2) In the Login Page, after you authenticate user, Redirect the user back to the page in the query string.
i.e.
if(Request.QueryString["PreviousPage"] != null)
Response.Redirect(Request.QueryString["PreviousPage"].ToString());
else
Response.Redirect("Some where else, might be your products page etc...");
|
|
|
|
|
the same approach I have used in my project and found simple way to implement this. Cheers!!
Brij
|
|
|
|
|
Your opinion was helpful.
Thanks..
|
|
|
|
|
Passing the page that performed the redirect to your login would be quite easy. Just use a querystring.
e.g
default.aspx
String url = Page.Request.RawUrl;
Response.Redirect(String.Format(CultureInfo.InvariantCulture, "~/login.aspx?pp={0}", url));
login.aspx
if(Request.RawUrl.Contains("?pp="))
{
string previousPage = Request.QueryString["pp"]);
}
Once you have your value you could use the login control LoggedIn event
to redirect to you original page using the query string you have captured.
I know it's a chore but I heartily recommend getting a book on Asp.Net. Most beginners books will have plenty of information about this.
Good luck!JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
Thanks. Your instruction was helpful.
|
|
|
|
|
Hi all,
I'm not sure if I'm heading in the right direction on this, if I'm making things over-complicated then please point it out and point me in the right direction!
I'm writing a search filter for my website where people can refine their search results by adding/removing filters like on many other websites. Ebuyer.com springs to mind as a rough example of what I'm trying to achieve.
I'm currently creating the filter list as a webusercontrol so that it can be added to more than one webform if required. I want it to interact with it's parent page by changing it's properties and running a couple of public methods (all on the parent page).
How do I go about accessing the parent page properties etc? I have tried creating a reference to the page class in the webusercontrol, but it refuses to recognise it. I'm writing it in c#, does anyone have an example they could show me of how I should be doing it, I would greatly appreciate it, or at least a reference to a good comprehensive article, as so far what I have found has led me down dead ends.
Any help would be appreciated.
Thanks
Mark
|
|
|
|
|
Sorry friend,
Your post is too long and still i am not clear,
According to me you want to make communication between User Control and Container Page, Right?
Then you need to user Properties to Access Control from Page.
And Events (You can pass any value as Event Argument, it can be a class) define in UserControl to communicate with the page.
Hope this might be useful to you.Best Regards,
Chetan Patel
|
|
|
|
|
how can i connect to sqlserver compact edition in web application ?
|
|
|
|
|
When i select 2 then nothing happens when i select 1 again then error msg fires for a while and disappears why it is so?
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True"
AutoPostBack="True">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem Value="2"></asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="DropDownList1" Display="Dynamic"
ErrorMessage="RequiredFieldValidator" InitialValue="1" SetFocusOnError="True"></asp:RequiredFieldValidator>
</div>
|
|
|
|
|
In the example above you don't need the validator since the dropdown always has at least 1 value available so remove it in the safe knowledge that when you parse the results the selected value of DropDownList1 will always contain a valid value.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
i want to bind crystal report in datalist ........so plz help me
|
|
|
|
|
Hello,
I have put my web project (which uses reporting services) into the web server for testing.
All works fine on th elocal machine but on the server I get this error when trying to access the reports:
The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. (rsAccessDenied)
What do I do to solve this please?
thanks
|
|
|
|
|
I have now done this:
go to the property tab and create a new group with name
BUILTIN\Users
And in the role assignment tick browser role
Now the error is :
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'dsDB'. (rsErrorOpeningConnection)
For more information about this error navigate to the report server on the local server machine, or enable remote errors
Any thoughts please?
thanks
|
|
|
|
|
Solved by using the correct user in sql server logins.
Thanks
|
|
|
|