Click here to Skip to main content
14,828,012 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Facing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
Member 1465772317-Nov-19 7:29
MemberMember 1465772317-Nov-19 7:29 
GeneralRe: Facing Issues while reading an excel file and inserting it's rows to a my sql tabble. Working fine in local machine but giving error after deployement Pin
phil.o17-Nov-19 9:26
mvephil.o17-Nov-19 9:26 
QuestionChange datatable from column to row and bind it to gridview Pin
Anand Solomon14-Nov-19 5:19
MemberAnand Solomon14-Nov-19 5:19 
QuestionAccessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Member 1115418813-Nov-19 18:34
MemberMember 1115418813-Nov-19 18:34 
AnswerRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
F-ES Sitecore13-Nov-19 23:23
mveF-ES Sitecore13-Nov-19 23:23 
GeneralRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Member 1115418814-Nov-19 0:17
MemberMember 1115418814-Nov-19 0:17 
GeneralRe: Accessing Master Page Methods in Content Page and Accessing this.Master page Control from Class Library Pin
Richard Deeming14-Nov-19 1:25
mveRichard Deeming14-Nov-19 1:25 
Question[Solved] Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 0:00
MemberMember 1115418813-Nov-19 0:00 
Hello Friends,

I have asp.net website and have few class libraries in the same solution.

I am trying to store a database retrieved datatable (it contains only one column) into Array variable and assigning the array into Session.
This code is in my aspx.cs page.

<b>Code is aspx.cs below:</b>
DataRow[] foundAuthors = dtPermission.Select("Value = '" + Permission + "'");
if (foundAuthors.Length != 0)
{
ArrayList permlist = new ArrayList();
foreach (DataRow dr in dtPermission.Rows)
{
permlist.Add(dr["Value"].ToString());
}
SessionHandler s = new SessionHandler();
s.SetSession(permlist, "sPermList");

I have the following code in the class library. But in this code the session value i am not sure how to assign as array list in test method. currently it is showing as string and not working. Please help.

<b>Class Library Code:</b>
public class SessionHandler : IRequiresSessionState
{
public SessionHandler() { }
public object GetSession(string key)
{
object session = HttpContext.Current.Session[key];
return session;
}
public void SetSession(object data, string key)
{
HttpContext.Current.Session.Add(key, data);
}

public bool Test(string sessionKey,string perValue)
{
string ss = GetSession(sessionKey).ToString();
--Here need to assign session value to array list and compare the perValue against array list (or) if we can directly compare session stored value and return true / false
return true;
}


}

Thanks in Advance,

Priya.

-- modified 14-Nov-19 6:23am.
AnswerRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 2:15
mveRichard Deeming13-Nov-19 2:15 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 2:48
MemberMember 1115418813-Nov-19 2:48 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 3:36
mveRichard Deeming13-Nov-19 3:36 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 4:58
MemberMember 1115418813-Nov-19 4:58 
Questionwhat is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin S11-Nov-19 18:10
professionalNitin S11-Nov-19 18:10 
AnswerRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Mycroft Holmes11-Nov-19 20:20
professionalMycroft Holmes11-Nov-19 20:20 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin S11-Nov-19 22:04
professionalNitin S11-Nov-19 22:04 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
jkirkerx13-Nov-19 9:56
professionaljkirkerx13-Nov-19 9:56 
Questiongridview with dynamic dropdownlist control null exception Pin
Anand Solomon11-Nov-19 4:41
MemberAnand Solomon11-Nov-19 4:41 
Questionvideo calling in asp.net Pin
Member 146439065-Nov-19 18:37
MemberMember 146439065-Nov-19 18:37 
AnswerRe: video calling in asp.net Pin
F-ES Sitecore6-Nov-19 1:04
mveF-ES Sitecore6-Nov-19 1:04 
AnswerRe: video calling in asp.net Pin
Blikkies6-Nov-19 1:28
professionalBlikkies6-Nov-19 1:28 
Questioni want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Member 134445211-Nov-19 20:17
MemberMember 134445211-Nov-19 20:17 
AnswerRe: i want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Richard Deeming3-Nov-19 22:33
mveRichard Deeming3-Nov-19 22:33 
QuestionASP.Net Core Identity Pin
Mycroft Holmes28-Oct-19 13:11
professionalMycroft Holmes28-Oct-19 13:11 
AnswerRe: ASP.Net Core Identity Pin
jkirkerx30-Oct-19 13:10
professionaljkirkerx30-Oct-19 13:10 
GeneralRe: ASP.Net Core Identity Pin
Mycroft Holmes31-Oct-19 11:13
professionalMycroft Holmes31-Oct-19 11:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.