|
Maybe. But every mention of it I've read in the past has been pretty much negative. Also, I'm looking for open source, as my needs are for a personal web site, not corporate.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Couldnt you just use the same database and merge the login tables into one?
We are not a Code Charity
|
|
|
|
|
Yeah, that's what I'm considering. I need to ascertain how hard it would be to merge both systems. I was mostly curious if anybody had existing code. Well, if I do so myself, I'll just have to post said code here for anyone else looking to do the same thing.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Hi
I created my site in asp.net 1.1 It has been running for quite a while now. However, recently, I have started having problems with it.
First, I was have a 'Unable to validate data' problem. I resolved this issue by adding the following to my web.config file:
<pages buffer="true">
enableSessionState="true"
enableViewState="true" enableViewStateMac="false" />
However, I am having another strange problem. I have a secure page (Web_page.aspx) and requires the user to be logged in to the site. I perform this check with the following code in web_page.aspx:
if(!Context.User.Identity.IsAuthenticated)
{
Response.Redirect("login_page.aspx");
}
else { continue with the page}
The problem is that: If a person is logged in and he clicks on the web_page.aspx link, the system redirects them to login.aspx page (the system should take them to the web_page.aspx page because the user is already logged in). At this if the user clicks on web_page.aspx link AGAIN, then it works correctly, i.e. I am taken to web_page.aspx.
As you can see, I have to click TWICE on this link to make it work correctly. This is happening with ALL the pages that require login. Very strange indeed.
Any idea what is happening here?
My system was working correctly in the past. This problem has just emerged.
|
|
|
|
|
What kind of Authentication you are using. Are you using some custom one or soem built in ASP.NET like Froms etc?
Cheers,
Ashik
|
|
|
|
|
To me , it does not seem like a authentication or session expiration problem. The users are still logged in when they click on the link twice.
It seems more like a caching problem on the client side
|
|
|
|
|
Have u first time checked the condition in the page load event when it redirects to login page?
Does the IsAuthenticated come False ?
Ashik
|
|
|
|
|
I originally posted this in the C# forum but was advised this may be the better place to get the answer.
I have a checkboxlist with different items. I have a comma separated values field that I need to bind to this cbl. The cbl is in a detailsview. I know that I need to loop through the dataset rows so each record in the detailsview is bound with the correct information, however I have only figured out how to bind the first row in the dataset for every record in the detailsview. I know I need to loop through the dataset but am not sure how to do it at the same time as looping through the rows in the detailsview. This below function is called onDataBinding. Can anyone assist?
Thanks in advance!
public void FillControls()
{
int intSN = Convert.ToInt32(Request.QueryString["LookUp"].ToString());
Selections db = new Selections();
DataSet ds = db.Services(intSNo);
int iCount = ds.Tables[0].Rows.Count;
if (iCount != 0)
{
if (dvGetMoreData.CurrentMode != DetailsViewMode.Insert)
{
FillMultipleCheckboxesWithValue((CheckBoxList)dvGetMoreData.FindControl("cblSvcs"), ds.Tables[0].Rows[0]["Services"].ToString());
}
}
}
~Candi
~Candi
|
|
|
|
|
I believe that in FillMultipleCheckboxesWithValue() runs some code for you that will make your problem clearer to me. Can you include this code in your reply?
|
|
|
|
|
Here is the FillMultipleCheckboxeswithValue
public void FillMultipleCheckboxesWithValue(CheckBoxList cbl, string strDBValue)
{
CheckBoxList chkFind = cbl;
string strEval = strDBValue;
if (strEval != " ")
{
string[] arrEval;
arrEval = strEval.Split(',');
int iCount = chkFind.Items.Count;
for (int i = 0; i < iCount; i++)
{
foreach (string str in arrEval)
{
if (chkFind.Items[i].Value.ToString() == str)
chkFind.Items[i].Selected = true;
}
}
}
}
~Candi
|
|
|
|
|
Just exactly what do you mean by "rows of the DetailsView"?? That doesn't make sense in the context of the problem, as each DetailsView should be associated with exactly ONE row (at a time) of the data source.
To review (and make sure we're on the same page) a DetailsView is designed to show one record (the "detail") of a list of records. Most often, the DetailsView is associated with something a like a GridView, so that by selecting one of the records displayed in the GridView you can look at it up close in the DetailsView.
I don't know in what context you're using the DetailsView. Is it standalone, so that you need to hit buttons to move it backward and forward? Is it associated with a GridView?
|
|
|
|
|
I am using the DetailsView as a standalone, yes. But when the checkboxes are populated, each record in the DetailsView displays the same checkboxes selected as the first record. However I have checked the data and the correct data is coming in. So I have narrowed the issue down to the population of the checkboxes. I don't know how to iterate through the records in the DetailsView so that the correct checkboxes are selected for each record.
~Candi
|
|
|
|
|
The answer is simple: your binding function never changes the Row index, so you always fetch data from the same row. You need to change the row to select the record you wish to currently display.
Some control is responsible for accepting the user's choice to change the current record. How does the user select when to move from one record to another? push a button? press Page Down or Down Arrow? I'm assuming it's a button of some sort, and the way to do this is by modifying the Click handler. Can you please attach the Click handler? or explain why that is impossible, if it is impossible? Thanks in advance.
|
|
|
|
|
The user pages to move from one record to another. This is the event that is called when they click to go to the next page of the detailsview.
public void dvGetMoreData_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
dvGetMoreData.PageIndex = e.NewPageIndex;
BindData();
}
~Candi
|
|
|
|
|
Perhaps you should change it to this:
public void dvGetMoreData_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
dvGetMoreData.PageIndex = e.NewPageIndex;
BindData();
}
public void FillControls()
{
Selections db = new Selections();
DataSet ds = db.Services(intSNo);
int iCount = ds.Tables[0].Rows.Count;
if (iCount != 0)
{
if (dvGetMoreData.CurrentMode != DetailsViewMode.Insert)
{
FillMultipleCheckboxesWithValue((CheckBoxList)dvGetMoreData.FindControl("cblSvcs"),
ds.Tables[0].Rows[dvGetMoreData.PageIndex]["Services"].ToString));
}
}
}
|
|
|
|
|
That works perfectly! However how could this work in a datagrid (I also use it there on another site) since each Page can have multiple records on the same page?
~Candi
|
|
|
|
|
|
Thanks so much for your help! I truly appreciate it.
~Candi
|
|
|
|
|
you're welcome
|
|
|
|
|
Ok I got it! I needed to use the DataGridItem.ItemIndex passed in to the row number of the dataset so the data would populate correctly. THanks for your help with this, cpkilekofp.
~Candi
|
|
|
|
|
Sorry to keep asking this but I let time go by and no one responds.
Now I tried the UPDATE panel for a gridview but it doesn't let you use the select feature within the gridview to select rows (which I need).
Now lets say we have gridview.aspx and add.aspx
on gridview.aspx to add a row they click ADD
so a new window comes up and that is add.aspx.
When they click the submit button (on add.aspx) is there a way to do a GridView.DataBind() from that button to update the gridview on the gridview.aspx page?
|
|
|
|
|
to my knowledge one page does not have access to another page's controls, so you cant bind the grid on your view page from the add page, however i believe it is possible to send messages from the child window to the parent window in javascript, or you can set the parent window to watch for the closed event of the child(assuming you have access to an object that represents the window/page you opened) and use that event to refresh the grid. I fairly certain you can do that in plain ol asp .net 1.1, and would assume it works with ajax if there isnt a better way..you could also hide the grid, show the add controls where the grid was(using seperate asp:panels) then when btnAdd is clicked the add panel goes invisible the grid goes visible, and the databind event is called (i've done that many many times in .net 1.1, and continue to use that method in code i've updated to .net 3.5(yes i know it runs on the 2.0 clr) even though there is probably a better way i have not yet invested the time to find it...i dotn get to set priorities of things i work on..thats the boss's job.
|
|
|
|
|
Thats a good idea I didn't think about.. the hiding and showing... see I have passed strings from one form to another with C# (applications) but not on a web site. I will try the hiding and see if I like. Thank you!
|
|
|
|
|
i used it with normal asp.net 1.1 and 3.5(or 2 whatever) web forms, but i've never tried that inside of an update panel with ajax, assuming thats what you ment by update panel. i dont see why it wouldnt work though. it should actually look pretty neat if it works correctly, if you have any questions feel free to ask i'll help if i can...dont forget to rate answers if they're helpful, provides feedback for people answering and helps people reading determin which posts to take seriously.
|
|
|
|
|
oh, I didn't notice that... but with the Update Panel (Ajax) I set it where it updated like it should.. couldn't even notice it was reloading the gridview or databinding... but the SELECT feature that I added to the GridView (the auto-generated one), it would not select the columns.. Wouldn't call the OnSelectionChange when you selected a row.. which I needed to see what the row was selected... even when it was selected and you tried pulling which row was selected it wouldn't do it.
Well got rid of the update panel, timer, and server manager or whatever and it worked fine with the exact code I had written..
something with it was messing it up
|
|
|
|