|
I created profile-node in "web.config",
but in code, Profile can not be identified?
|
|
|
|
|
in my project, in login form ,i want to use role as admin and user. i made one table in sqlserver2000 and specify the role
then according to role how i login. plese specify the code
Signature preview salil_k_singh 11:06 15 Jul '07
|
|
|
|
|
I am not sure if there's any role based stuff build in, but you can store what someones role is. in the session, or call the data layer to tell you this based on the login. The idea is, your login user has one or more roles, then the roles define what can be done. You use roles so you can specify what a group of people can do, not just one person.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can set the roles as admin and user by using 1 and 0. Apply the admin user the number 0 and normal user 1. Then you can just check which number is logging on to determine what facilities to let that person use.
|
|
|
|
|
i m developing a project in asp.net with c# (.net 2005, 2.0 framework)
when i create a dropdownlist and fill the value and process the function
"combobox1_SelectedIndexChanged(object sender, System.EventArgs e)"
is calling twice automatically. whatever the content i placed inside this function, its calling twice.....
y?
help me - KARAN
|
|
|
|
|
Hard to say, it gets called once for me. Must be something to do with your code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Have you called this function/event from anywhere else?which may trigger at the same time when combo SelectedIndexChanged event fired.
|
|
|
|
|
I have a gv in my page. It has two bounded columns and edit column. I tried to update a single column but it went to edit mode but it didnt update the data. not even it goes into the roaw_updating event. what should i do now. can someone help me.
I want a gridview to edit a single column in edit mode.
G Nathan
|
|
|
|
|
You have to define a template to edit only the one row, Idon't think you can easily change which row is edited. However, it's hard to say more, because
a/ there's tons of tutorials on this on the web, all of them work, your code must be broken
b/ you didn't post any code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi christian,
Yah i got the solution. I made a mistake on validators thats what it doesnt call update event... thanks for ur support
G Nathan
|
|
|
|
|
Thanks I have solved the Problem.
Hello all,
In my application i have defined a array and dynamically i have created checkbox. Now i am finding the how meny checkbox user have checked by finding the length of array by using following code.
[code]
Dim qidArr() As String
Dim chkQues As CheckBox
Dim i As Integer
Dim sqid, lastid As String
For i = 0 To tableQuestion.Rows.Count - 1
chkQues = CType(tableQuestion.FindControl("chk" & i), CheckBox)
If chkQues.Checked = True Then
lid = CType(tableQuestion.FindControl("lblQid" & i), Label)
If ViewState("qid") <> Nothing Then
lastid = ViewState("qid")
sqid = lastid & "," & lid.Text
qidArr = sqid.Split(",")
Else
sqid = lid.Text
qidArr = sqid.Split(",")
End If
ViewState("qid") = sqid
ViewState("total") = qidArr
End If
Next
If qidArr.Length = 0 Then
Return 0
'ElseIf qidArr.Length = 0 Then
ElseIf qidArr.Length > 3 Then
Return 1
ElseIf qidArr.Length > 0 And qidArr.Length < 4 Then
Return 2
End If
[/code]
but the problem is that if user dosenot check any checkbox the it goes into exception [code]qidArr.Length = 0 [/code] after this statement.
Can anybody tell me how can i check length of array=0.
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Monday, April 28, 2008 1:57 AM
|
|
|
|
|
I suspect in this case, it's value is null.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i define a usercontrol and create it and put it in c:\ . then i use this code but i dont know the format of the path can any body help me?
protected Control userControl;
string userControlPath = @"c:/LitwareUserControl.ascx";
this.userControl = this.Page.LoadControl(userControlPath);
this.Controls.Add(this.userControl);
it gives this error: 'c:/LitwareUserControl.ascx' is not a valid virtual path.
|
|
|
|
|
You can use that User Control in the ASP.Net page itself.
like,
<%@ Register TagPrefix="UC1" TagName="IncludesAdminTop" Src="IncludesAdminTop.ascx" %>
Place this after the Page Directive.
Then
<UC1:IncludesAdminTop id="AdminTop" runat="server"></UC1:IncludesAdminTop>
Place this After or Before Body Tag
|
|
|
|
|
I dont want to use it in asp.net page. i use it in webpart so i can not use this way
|
|
|
|
|
Hi
In my project(C#.net) im getting the datetime from user and store it in the database. The given DateTime is the local Datetime.Our server is in USA.
I need to Convert the Given DateTime to Server Datetime before store it into the DB.
Moghan
|
|
|
|
|
To do that, you need to find out the end users time zone. A geolocation database, or asking hte user to tell you, seem the most likely solutions.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ive been searching for any implementations of logincontrol with CAPTCHA
Ive founf a few, but none of them is what i have in mind
The "Best" i found (4guysfromrolla) always requires the user to input the captcha code
What i want is to only requiere captcha after 3 failed attemps (In a n mins period)
Using asp membership to lockout a user is not an option
Im have the following options and problems:
Option: I could count the failed attemps in the session, viewstate, etc
Problem: If the user closes the page, the count will be restarted
Problem: If it is an automated user, it can create a new session on each request
Option: Use IP to track retries
Problem: If it is an automated user, it can use proxies, and so can a normal user
Problem: Not all people has public IP, and if i use this approach, i would be requiring all users behind the blocked IP to imput the captcha control
Has anyone implemented something similar?
Please lt me know of any other ideas you might have
Thanks in advance
Alexei Rodriguez
|
|
|
|
|
iam having ddl control in update panel ..now i want ot execute javascript in ddl selection index changed .how could be solved...
|
|
|
|
|
Page.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Test_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>A</asp:ListItem>
<asp:ListItem>B</asp:ListItem>
<asp:ListItem>c</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Page.aspx.vb
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
ScriptManager.RegisterStartupScript(Me, Page.GetType, "X", "alert('" & Me.DropDownList1.SelectedValue & "')", True)
End Sub
Alexei Rodriguez
|
|
|
|
|
thank u mr.AlexeiXX3 when iam taking ur example it is working fine..but the same i did in my project
but it is not firing the javascript ...any problem ..?
|
|
|
|
|
use onchange event for dropdownlist..
For Example..
function Test()
{
alert(document.getElementById('ddlId').value);
}
<asp:dropdownlist id="ddlId" onchange="Test();" runat="server">
|
|
|
|
|
Dear all,
I want to refresh data of GridView which on Web User Control (this Web User Control is in another Web User Control) after user closes pop up which is used to modify or add new data.
I use the following code but it does not works :
Response.Write("self.close(); opener.focus(); opener.location.href =\"javascript:__doPostBack('ctl00_testContentPlaceHolder_testContentUsrCtrl_LeftMessageUsrCtrl_btnRefresh','');\"");
If user click btnRefresh, it works fine.
Please tell me how I can do this.
Thanks in advance.
|
|
|
|
|
Hi,
I have a problem passing the value from parent to child. Can you please help? Thank you. My code:
protected void Message_To_Play_CheckedChanged(object sender, System.EventArgs e)
{
SqlConnection myConnection2;
myConnection2 = new SqlConnection("Data Source=oks\\sqlexpress;Initial Catalog=didb;User ID=sa;Password=AD");
SqlDataReader rdr = null;
try
{
myConnection2.Open();
SqlCommand myCommand2 = new SqlCommand ("SELECT TOP (1) RecNum FROM OUTDIAL_CAMPAIGN ORDER BY RecNum DESC", myConnection2);
rdr = myCommand2.ExecuteReader();
while (rdr.Read())
{
//HttpContext.Current.Response.Write("Your Record Number: " + rdr[0] + "");
// It write on the same page
HttpContext.Current.Response.Write("window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'dependent=yes, resizable=yes, width=300, height=100');");
}
}
finally
{
// close the reader
if (rdr != null)
{
rdr.Close();
}
// Close the connection
if (myConnection2 != null)
{
myConnection2.Close();
}
}
// Done Querying the table to get the highest recnum.
}
|
|
|
|
|
R u getting any Error? I think u have Syntax error in this line
HttpContext.Current.Response.Write("<script language="JavaScript">window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "'dependent=yes, resizable=yes, width=300, height=100');</script>");
Try this,
HttpContext.Current.Response.Write("<script language='JavaScript'>window.open('PopUpMessage.aspx?RecNum='" + Server.UrlEncode(this.rdr[0])+ "','Test','dependent=yes,resizable=yes, width=300, height=100');</script>");
|
|
|
|