|
I fill the data in to my dataset(dsCode) and then add in to dropdownlist (ddlCode).
strsql = "Select Code, Name From UsersList"
ddlCode.DataValueField = "Code"
ddlCode.DataTextField = "Name"
ddlCode.DataBind()
By this way only, I can bind the data in to drop down list.
Balasubramanian K.
|
|
|
|
|
here you can restrict the number of records that will add in dropdown list.
but how you will show other records ?
|
|
|
|
|
Actually, My question is that.
My query is retriving more than 100 records. When click the drop down list, it should show top 10 records only with vertical scroll bar. By using the vertical scroll bar user has to move the 11th record, 12th record in such way. I have to code according to the above condition.
Balasubramanian K.
|
|
|
|
|
what is the use of this statement FormsAuthentication.SetAuthCookie(oUserID, False)
if i assign in login page what happen, how to check after login user verified or not which condition i need to check
Request.IsAuthenticated is always showing true,
when it will be true and when it will false,
for setting Request.IsAuthenticated =true what we need to do
This is haneef.............................................................
|
|
|
|
|
For the web based application such as ASP.NET, there has limited storage to
persist some status info between client and serverside, cookie is the most
common one, so generally sessionState , Forms based authentication's ticket
... are all stored in cookie by default. When cookie is not allowed, URL
string is the only alternative. There is no other place which can help
store info (specific to a certain client/browser) and can be accessed by
server .....
Also, as for Response.Cookies.Add(cookie), it always add the value into
the ASP.NET response's cookie collection (Forms Authentication or Session's
cookieless setting won't affect it). Also whether the Response.Cookies
collection's new values will be persisted at client depend on the
clientside browser's setting (browser support cookie or not , user allow
cookie or not....)
For general ASP.NET application user state management approaches, here is a
msdn article mentioned some common approaches:
#Nine Options for Managing Persistent User State in Your ASP.NET Application
However, if we need to some info persisted at clientside and to associated
some serverside resources/data, cookie or url string will be the only
approaches so far we have....
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I have come across the "Operation Aborted" message before, and typically its caused by trying to alter the DOM before its completely loaded. This will happen for all current versions of IE (5.5, 6, 7). I have run into an occurence recently where i get the error in IE7, but not IE6. Has anybody had this weirdness before?
|
|
|
|
|
Hi -
I am trying to allow access to users to multiple projects with a common login page. In other words I would like to save the username, and the roles in session variables and use this session variable in other applications to authenticate roles and access. I seem to lose the session variables as I redirect to another project. Is there a way to save these session variables so that I canhave a single point of signon and share it across applications? Have read a lot about but am having problems getting it to work. Thanks in advance.
|
|
|
|
|
First of All This is a very good Question.
Well, You can Do it.
First of All There are Following mode of Session
1.inProc<br />
2.Off<br />
2.SQLServer<br />
4.StateServer<br />
5.Custome
Now Your Option Are
1. Use SQLServer Mode and Save Session on DB and Retreive from Other Appliaction.
2. If Both of your application runs on same AppDomain , then you can do it using inProc
3. User Some Other Methods to save data may be usinh Cookies
Let me know if its helps you.
|
|
|
|
|
|
Hi Abhijit-
Thanks for responding. I had looked at the link you suggested earlier and was unable to get it to work. Hope I could reach the author but don't know that I can. Any suggestions?
Thanks
|
|
|
|
|
Hello all,
I'm at a fairly large company that has a number of ASP.NET applications running on our servers. The apps all use various back end databases to store data and do various operations. Because of IT policies, devs are no longer allowed to access production servers. Passwords, including those for service accounts, are to be changed on a regular schedule. So, I'm thinking that it might be possible in ASP.NET to set the account that each app uses and then used trusted connections for SQL server to do what we need. That way, the network operations people can change passwords without us being involved.
This is all due to Sarbanes-Oxley and HIPAA (as well as just common sense corporate security). Has anybody had to deal with this? If so, what did you use to streamline configuration management of your various deployed applications? Are there any solutions that you would recommend avoiding?
Thanks,
Will
|
|
|
|
|
i want to create a web form for my where employees ask clients certain questions and it is registered in a database. the page should have group roles, admin, user , etc... i want to also have a admin panel where only the admin can login and change password. i want be able to generate reports from data within the form. i want validate on entry of data on a page. can u guide me in the right direction please
Ferron
|
|
|
|
|
4guysfromrolla.com has some nice examples on basic webforms and more advanced things, you could also pick a place(connecting to database, creating web form, UI, etc..) to start and try google searches or article searchs here for whichever piece you are currently working on. If you dont want to do it yourself you could try rent-a-coder or a consultant firm, mabye even craigslist if you're in one of the cities it has listings for, or somone here may hired to do it. When i was starting out this site and 4guysfromrolla had great articles and tutorials for almost any individual piece i needed to use.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I have a login user control on my master page. when someone log's out, it takes you back to my main page that uses the same master page.
everything works great if they use the asp:menu to navigate.
however, if the user log's out, the site takes them back to the main page and everything looks ok.
if they then navigate to a different page by clicking the asp:menu, the login controls page_load event gets fired ok. But if they type the url in the browser window, the page load event of the user control does not fire.
this is big problem for me. anyone have any ideas?
thanks.
chris
|
|
|
|
|
i think u have error in user control when u have error in user control the page_load will occur even though it is html error also in desing example:
in above line u align multiple times this error not show at complile time, but page_load not occur check all syntax of your user control
for more: sk.haneef@gmail.com
This is haneef.............................................................
|
|
|
|
|
Thank you for your help but I don't think you understood the question.
The page load event fires for the control at all times when someone clicks the menu. however, it does not fire when someone types the url directly into the browser. is it some sort of page caching issue maybe? any ideas anyone?
|
|
|
|
|
I figured out the problem. It was loading a cached version of the page when a user typed the page into the browser.
i just changed the response.expires = 0;
in the page load of the control. it works fine now.
thanks.
|
|
|
|
|
Anybody can help me please!
I have a asp.net page (vb) where I need to create Dynamic Controls. the situation is as follow
I have two links one is inside the panel (add range) and other is outside the panel (add component).
when I click the addrange then the four text boxes are going to add in the panel and when I click on addcomponent then one panel with dropdown box is going to create on the page. I done it but when I click the addcomponent the panel is adding on the page but the boxes on the first panel comes down with the 2nd added panel and first panel does not contain addrange text boxes. I am using webcontrol files. AddRange.ascx and AddComponent.ascx. my code is as follwo.
-----Add Panel----
'Add Panel (component)
Private Sub AddAndRemovePanel()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddComponent" Then
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) + 1
End If
End If
PH2.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH2.Text) - 1)
Dim DynamicUserControl As AddComponent = LoadControl("AddComponent.ascx")
While InDeletedList1("uc1" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc1" & ControlID
AddHandler DynamicUserControl.RemoveUserControl1, AddressOf Me.HandleRemoveUserControl1
AddHandler DynamicUserControl.SelectComponent, AddressOf Me.handleSelectComponent
PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
populateADDComponentDropDown()
' MsgBox(ltlCountH3.Text)
' MsgBox("ltlCountH3=" & ltlCountH3.Text)
' MsgBox("ltlCountH1=" & ltlCountH1.Text)
' MsgBox("ltlCountH2=" & ltlCountH2.Text)
End Sub
Private Function InDeletedList1(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH2.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl1(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As AddComponent = sender.parent
PH2.Controls.Remove(sender.parent)
ltlRemovedH2.Text &= DynamicUserControl.ID & "|"
ltlCountH2.Text = Convert.ToInt16(ltlCountH2.Text) - 1
End Sub
--------AddRange-------------
'Add Range in Panel
Private Sub AddAndRemoveDynamicControls2()
Dim c As Control = GetPostBackControl(Page)
If Not IsNothing(c) Then
If c.ID.ToString = "btnAddRange" Then
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) + 1
End If
End If
'PH3.Controls.Clear()
Dim ControlID As Integer = 0
For i As Integer = 0 To (Convert.ToInt16(ltlCountH3.Text) - 1)
Dim DynamicUserControl As WebUserControl = LoadControl("AddRange.ascx")
While InDeletedList("uc3" & ControlID) = True
ControlID += 1
End While
DynamicUserControl.ID = "uc3" & ControlID
AddHandler DynamicUserControl.RemoveUserControl, AddressOf Me.HandleRemoveUserControl2
For Each c2 As Control In PH2.Controls
If c2.GetType.Name.ToLower = "addcomponent_ascx" Then
Dim uc As UserControl = CType(c2, UserControl)
Dim mypanel As Panel = uc.FindControl("panel1")
mypanel.Controls.Add(DynamicUserControl)
Else
MsgBox("not found")
End If
Next
'PH2.Controls.Add(DynamicUserControl)
ControlID += 1
Next
End Sub
Private Function InDeletedList2(ByVal ControlID As String) As Boolean
Dim DeletedList() As String = ltlRemovedH3.Text.Split("|")
For i As Integer = 0 To DeletedList.GetLength(0) - 1
If ControlID.ToLower = DeletedList(i).ToLower Then
Return True
End If
Next
Return False
End Function
Sub HandleRemoveUserControl2(ByVal sender As Object, ByVal e As EventArgs)
Dim DynamicUserControl As WebUserControl = sender.parent
PH3.Controls.Remove(sender.parent)
ltlRemovedH3.Text &= DynamicUserControl.ID & "|"
ltlCountH3.Text = Convert.ToInt16(ltlCountH3.Text) - 1
End Sub
|
|
|
|
|
Hello everyone!
this seems to be simple but does not work for me
I added an image control ro my asp.net page, now i need to choose the image to be displayed.
going to the imageurl property and openning a image select browser but I can't see any images , eve though I have placed images under app_data dir and also created an images dir under my project and placed images there as well.
It does not give me to nevigate in my computer only shows me app_data folder under http//localhost/myproject.
If anyone has an idea I will bevery greatful
Thnak you all
|
|
|
|
|
i am new to this field, but i faced the same problem,
do one thing, in the source file (.aspx.cs) search for the code of the image control, there look for the url of the image, now change this url to the full path of ur image ....
u will see the image, as u do ctrl+F5 .....
|
|
|
|
|
Generally I create a folder called images, in the web site part of the solution.
When adding an image, it depends on what you need it for. If it doesn't have any functionality aside from decorational (i.e. part of the layout), just add a simple html img tag
<img src="images/my_image.jpg" alt="" />
This assumes that your aspx file is in the same folder as the subfolder images.
If you need it for the execution of some server side coding, then you add:
<asp:Image Id="imgMyImage" ImageUrl="images/my_image.jpg" runat="server" />
I'm assuming, that the image you want to add, is not within the solution, which is why it might not be showing.
Adding the folder:
- right click on the solution name and click on new folder
- rename the folder to what you want
Adding the image:
- right click on the newly added folder and choose add existing Item
- look up the image file you want to add.
After this, inside the application folder, you will have a new folder which will contain the image you need.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
zvit wrote: and openning a image select browser
What is this ?
zvit wrote: It does not give me to nevigate in my computer only shows me app_data folder under http//localhost/myproject.
You can't grab images outside of your app project.
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 )
|
|
|
|
|
Eventhough I have disabled viewstate for the Page and the checkbox control, it is still maintaing the checked state after postback.
|
|
|
|
|
I have a SQL 2005 database which contains the path to Word documents and graphics. I would like to create a web site to display the files. I have never uses ASP .NET. What is the best way to get started learning how to create a simple web site? Any suggestions of beginner books or sites to visit?
thanks
|
|
|
|
|