|
I have a Label control inside the LoginView's LoggedInTemplate. How do I access it ? I've tried the following:-
Label lbl_Role = (Label)LoginView1.FindControl("Label1");
But it returns nothing.
When I checked the properties of the label in the design view its path read as:- LoginView1.LoggedInTemplate.Label1
However, the LoginView1.LoggedInTemplate property does not have a FindControl() method. Is there anyway in which I can access the Label ?
Thanks
|
|
|
|
|
Is the control you are looking for in active template? What this mean is that with loginview control only one template is active at any given time i.e. its either <AnonymousTemplate> if user is not logged in or <LoggedInTemplate> if use is logged in.
Make sure the control you are looking for is within active template. \
hth
|
|
|
|
|
i am trying to create a asp.net page to unlock accounts in Active Directory.
before I get into passing the account through the UI I am just plugging it directly into the code.
The code below is not unlocking the account. (i have access to AD and locked the account myself, and can see that it is still locked)
I was even trying to see if the display name would come up if attached to a label.text and it wouldnt. what i am i doing wrong?
aspx.vb file
Imports System.DirectoryServices<br />
Imports System.DirectoryServices.ActiveDirectory<br />
<br />
Partial Class testing_Default2<br />
Inherits System.Web.UI.Page<br />
<br />
Public Sub Unlock(ByVal userDn As String)<br />
<br />
Try<br />
Dim uEntry As DirectoryEntry = New DirectoryEntry("LDAP://domaincontrolleraddress/CN=Brady Demo,DC=inside,DC=jonesknows,DC=com", myusername, mypassword)<br />
'domaincontrolleraddress is exactly what it says. myusername and my password are to be replaced<br />
uEntry.Properties("LockOutTime").Value = 0<br />
Label1.Text = uEntry.Properties("displayName").Value <br />
'unlock account<br />
uEntry.CommitChanges()<br />
'may not be needed but adding it anyways<br />
uEntry.Close()<br />
Catch E As System.DirectoryServices.DirectoryServicesCOMException<br />
'Label1.Text = E.Message.ToString()<br />
End Try<br />
End Sub<br />
<br />
End Class
aspx file"
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="testing_Default2" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head runat="server"><br />
<title>Untitled Page</title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<br /><br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" <br />
onclientclick="Unlock()" /><br />
<br />
<asp:Label ID="Label1" runat="server" ></asp:Label><br />
</div><br />
</form><br />
</body><br />
</html>
|
|
|
|
|
How to invoke the jscript validation-function at the button click event, if there's another code to be processed in that same button click event which is for eg: after validation to save to the database?
|
|
|
|
|
|
hi every buddy,
well recently I've started working on a shopping cart project which has some serious session Management issues. So anyhow, we decided to get the session management working with SQL Server and that's the first time I'm doing it. So I read some articles and made a test app for using it this way. Now there's a question buzzing in my mind.
Does .NET delete the record made in the SQL Server database for this Session Mgmnt purpose? I suppose it should, but if it doesn't do we need to build our own mechanism to do that? Looks pretty far fetched to me but still I thought I should ask the experts out there for a good suggestion.
Thanks in advance.
|
|
|
|
|
Anybody knows a 3rd party TreeView that can be bound to Object
I would like to write something like this:
MyOwnCollection x = new MyOwnCollection();
treeViewControl.DataSource = x; I tried RadTreeView from Telerik. But it failed to read the Parent-Child relationship
anybody has any suggestion ?
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
treeviews need to populated with a recursive function normally, as far as my knowledge goes, I think you'd better try using that technique instead of wasting ur time getting a third party control for this. The normal tree view should suffice I think.
Populate TreeView from Database [^]
you might like this one too[^]
Hope that helps
|
|
|
|
|
I want to upload a file into server but i don't want to use <asp:fileupload xmlns:asp="#unknown"> control because i am not taking the file from client browser. i want to take file name from server side only.
but <asp:upload> control not taking the filename at server
side.
If any one can give the suggestion i will really appreciate.
i will give client side file, i need to upload into server.
|
|
|
|
|
First decide what you wanna do...
|
|
|
|
|
|
Do not repost the question in every forum
|
|
|
|
|
Well, thats strange...
I got score 1 for asking not to repost ...
modified on Wednesday, August 13, 2008 11:24 AM
|
|
|
|
|
It's a brave new world around here. You get 1 votes whenever you fail to post a complete working solution that can be mindlessly copied and pasted.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Well, I suppose he did not like me to comment on his repost
but I was really surprised to see his impatience. There was not even a difference of two messages between his last post.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Sorry but dint quite get what want 2 do.
http://aspdotnetnstuff.blogspot.com
|
|
|
|
|
Sir what code u gave , this code only help you in adding one row but when u want to add more row how to deal with
I mean
i added a row in which text box was there thrugh u can enter data but after filling it i want to add more rows to it
but i m not able to do it so can you guide me how to add more rows to grid
as
code is
Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PreRender
'Dim GV As GridView = CType(sender, GridView)
'Dim Tbl As Table = CType(GV.Controls(0), Table)
'Tbl.Controls.AddAt(0, AddEmptyRow)
Dim GV As GridView = CType(sender, GridView)
Dim int As Integer = GV.Controls.Count
Dim Tbl As Table = CType(GV.Controls(1), Table)
Tbl.Controls.AddAt(1, AddEmptyRow)
End Sub
Function AddEmptyRow() As GridViewRow
Dim GVR As GridViewRow = New GridViewRow(0, 0, DataControlRowType.EmptyDataRow, DataControlRowState.Normal)
Dim myTableCell As TableCell = New TableCell
For i As Integer = 1 To 3
Dim myHyperLink As TextBox
myHyperLink = New TextBox()
myHyperLink.Width = New Unit(225)
myTableCell.BorderStyle = BorderStyle.Solid
myTableCell.BorderWidth = New Unit(1)
myTableCell.Width = New Unit(700)
myTableCell.BorderColor = Drawing.Color.Black
myTableCell.BackColor = Drawing.Color.MistyRose
myTableCell.Style.Add("text-align", "center")
myTableCell.Controls.Add(myHyperLink)
GVR.Cells.Add(myTableCell)
Next
Return GVR
End Function
Raghvendra
|
|
|
|
|
CS1012: Too many characters in character literal
OnClick="javascript:window.open('catagory1.aspx')"
while i use onClintClick its work properly.
i want to open a new window and close previous window and onclint problem is that firstly open a page when i click next time on page than its show last time record beacause session value is comes from server onclick.
how can i solve this problem
please help
thanks
I will do my best?
|
|
|
|
|
One way people can tell a job was outsourced to india is the spelling errors. Like catagory.
OnClientClick is obviously what you want here, OnClick means you want to call a server side method. So, why are you trying to use it ? Why are you using a server control at all, if it just calls some javascript ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: One way people can tell a job was outsourced to india is the spelling errors. Like catagory
This comment is totally unnecessary.
|
|
|
|
|
Christian Graus wrote: One way people can tell a job was outsourced to india is the spelling errors
Christian,
I am an Indian and I was told in my primary school that the first letter of a proper noun should be capitalised. For your information, India is a proper noun.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
modified on Wednesday, August 13, 2008 6:01 PM
|
|
|
|
|
tell me a good javascript ebook on net
saurabh bhardwaj
|
|
|
|
|
I am not sure if they do have PDF version too, but this is one of the best organized JavaScript tutorial.
|
|
|
|
|
What book did you recommend?
|
|
|
|
|
I want to display on my intranet web page the username of the person that is logged onto the computer. I tried System.Environment.userName but it sometimes gives me "ASPNET”. Can someone please help me?
|
|
|
|