|
hai,
Thnks for your reply.
I have created one product that is Priviliges engine.It will set privilige for Users who are all employees of one particular site.Admin will create employee login and set priviliges to them.Each and every employee will have some work in admin part.Every employee can do only their allocated work.They will not be allowed to visit other pages for which they do not have rights.
To restrict those pages, i need to check their privilige in each page_load event.For that I need to check in a single place,instead of check in each page_load.So that only I have asked to catch the page name in server place.
Thanks in advance
Mekalaasri
|
|
|
|
|
Ok. It is better to use inherited page. Another option is you can create a static method which checks for user permission, ofcourse you could pass the webform.
-- modified at 7:59 Thursday 22nd June, 2006
|
|
|
|
|
Hello to all,
I need to save datagrid into database by using Arraylist.
Please tell me how do I start with this.
Thanks and Regards.
|
|
|
|
|
Hi,
Can you explain your problem in detail.
|
|
|
|
|
Hi,
Actually I have Viewstate datatable and using this I am displaying Datagrid Contents.
Now I want to save the datagrid into database using Arraylist on Button Click event.
I hope I have made my self clear.
Thanks and Regards.
|
|
|
|
|
You can directly save those values using a datatable.
Why do you want a arraylist?
|
|
|
|
|
Can I manage the Transaction with this, if yes then can u please give tell me how to go about it.If No then i need to use Arraylist only because I know I can manage the Transaction.
Thanka and Regards.
|
|
|
|
|
You can manage transactions through front end also.
Go through this link this may help you a bit.
http://www.c-sharpcorner.com/asp/Code/TransactionsInASPNETDPL.asp
Best Regards,
Apurva Kaushal
|
|
|
|
|
I can manage Transaction Front end also but I dont want as my code for Transaction is in Class file because of this I will have to change code on every form which i dont want.
Please help me in saving datagrid (whose data is display with the help of Viewstate Datatable)into Arraylist.
Thanks and Regards.
|
|
|
|
|
probably i am not been able to understand your problem. but if what i have understood is correct then you can maintain the complete transaction in class file itself and just pass the datatable or any parameter you want from your pages.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Cant we use Arraylist for this????
|
|
|
|
|
how are storing the data in arraylist?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Following is the code what I am using:::
private void ibtnSave_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Classes.CChecklist cchecklist = new Classes.CChecklist();
int result = -1;
DataTable dt = new DataTable("ChecklistMod");
dt = (DataTable)ViewState["dtCheckList"];
ArrayList arrDataGriditems = new ArrayList();
for(int cntRow = 0; cntRow < dt.Rows.Count ; cntRow++)
{
for(int cntCol = 0; cntCol < dt.Columns.Count ; cntCol++)
{
string str = dt.Rows[cntRow][cntCol].ToString();
arrDataGriditems.Add(dt.Rows[cntRow][cntCol]);
cchecklist.CheckListInsert.Add(dt.Rows[cntRow][cntCol]);
}
}
result = cchecklist.InsertChecklist();
if(result == 1)
{
lblError.ForeColor = System.Drawing.Color.Green;
lblError.Visible = true;
lblError.Text = "Record Inserted";
}
else
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Visible = true;
lblError.Text = "Record Not Inserted" + ":" + cchecklist.LastError;
}
}
Bue I not able to get elements in
cchecklist.CheckListInsert.Add(dt.Rows[cntRow][cntCol]);
but I am getting elements in
arrDataGriditems.Add(dt.Rows[cntRow][cntCol]);
Please let me know where I am going wrong.
Thanks and regards.
|
|
|
|
|
What is the purpose of this method cchecklist.CheckListInsert.Add()
varshavmane wrote: Bue I not able to get elements in
cchecklist.CheckListInsert.Add(dt.Rows[cntRow][cntCol]);
but I am getting elements in
arrDataGriditems.Add(dt.Rows[cntRow][cntCol]);
Both the places you are using same thing("dt.Rows[cntRow][cntCol]" and dt.Rows[cntRow][cntCol]) so how could it be different.
Best Regards,
Apurva Kaushal
|
|
|
|
|
cchecklist.CheckListInsert.Add() is nothing but Arraylist Property of Checklist class.
It is assigning the dt.Rows[cntRow][cntCol] value to arrDataGriditem.Add() but not to cchecklist.CheckListInsert.Add()
This is where I am facing problem.
Thanks and Regards.
|
|
|
|
|
If both accepts same type of parameters and if you are providing same parameter values then obviously they should behave same manner if they are intended for the same purpose.
Best Regards,
Apurva Kaushal
|
|
|
|
|
But they are not initialize to the values of datatable as it is initialize to Local arraylist variable.
Can u please tell me what is the problem???
Thanks.
|
|
|
|
|
that depends upon what you are doing in cchecklist.CheckListInsert.Add().
Best Regards,
Apurva Kaushal
|
|
|
|
|
It is just a property code as follows:
public ArrayList CheckListInsert
{
get
{
return checklistInsert;
}
set
{
checklistInsert = value;
}
}
This code is in class file.
Thanks and Regards.
|
|
|
|
|
you cant add the value like that for the property of type arraylist.
for(int cntRow = 0; cntRow < dt.Rows.Count ; cntRow++)<br />
{<br />
for(int cntCol = 0; cntCol < dt.Columns.Count ; cntCol++)<br />
{<br />
string str = dt.Rows[cntRow][cntCol].ToString();<br />
arrDataGriditems.Add(dt.Rows[cntRow][cntCol]);<br />
<br />
<br />
<br />
}<br />
}<br />
cchecklist.CheckListInsert.Add(arrDataGriditems);<br />
I think this will solve the problem.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I have just given the code for the looping and after that. You just replace them only.
Best Regards,
Apurva Kaushal
|
|
|
|
|
No its not working.....
Thanks and Regards.
|
|
|
|
|
are you getting any compile time error?
Best Regards,
Apurva Kaushal
|
|
|
|
|
No I am getting runtime error saying :
"The name 'ArrayList' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."
I dont know what is the problem????
Thanks and regards.
|
|
|
|
|
you try like this:
for(int cntRow = 0; cntRow < dt.Rows.Count ; cntRow++)<br />
{<br />
for(int cntCol = 0; cntCol < dt.Columns.Count ; cntCol++)<br />
{<br />
string str = dt.Rows[cntRow][cntCol].ToString();<br />
arrDataGriditems.Add(dt.Rows[cntRow][cntCol]);<br />
<br />
<br />
<br />
}<br />
}<br />
cchecklist.CheckListInsert=arrDataGriditems;
Best Regards,
Apurva Kaushal
|
|
|
|