.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Questions for DetailsView

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net


I have created a detailsView control to add/edit/delete profiles on the application which has a field "Country Name". What I would like to do is that, when "insert Template" is selected there is a Dropdown list with list of countries.  But when edit template is selected, there can be two possibilities. If the "type" field from my query string says "a" then I should be able to select any country from the dropdownlist. But if the "type" field says "b" then the dropdownfiled should be disables and should show the original country of the person.

I tried adding a dropdowm list in details view "ItemTemplate", ddCountryList. But now when I try to access it in the code file, it says "ddCountryList" does not exists in current context.

What can be the reason and how can disable and enable a control based on querystring value?

Thank you.

View Complete Post

More Related Resource Links

Questions with GridView/DetailsView Refresh


I have a Gridview that when a record os selected it opens that record in a Detailsviews for Editing, Updating, Inserting and etc.  That is working perfectly but I have two related questions....

1. If I select "New" or "Edit" in the DetailsView I want the cursor to be located in the first field reading for entereing. How can I make this happen?

2. If I update a record selected in the Gridview in the DetailsView, the record is updated in the SQL table but the update is not reflected in the GridView.  Even after refreshing the link the GridView does not display the updated data. How can this be corrected?

All comments appreicated!

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

C# Interview Questions

C# Interview Questions
This is a list of questions I have gathered from other sources and created myself over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far.

There are some question in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them easy access

Frequently Asked Questions - SQL Server Data Types

This is good and precise introduction and Frequently Asked Questions - SQL Server Data Types

Linq qry with order by basic questions


I have never tried a group by with linq, now I do and I'm stuck.

I try to convert this sql statement to its linq counterpart :

SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id

Is there some one who can me show me the convertion process ?

Questions about getter and setter


I created a getter and Setter in Visual Basic. I have some questions though. Please look at the code below.
Here are my questions.

A.) At line 1 below, should "pieces" be declared as Private?
B.) In the IDE at lines 4 and 7 the IDE keeps changing those variables to uppercase so that the property name "Pieces" is the
    same as the variable name "pieces".Should I instead define the integer pieces with an underscore: _pieces ?
That is the only way I can get around the IDE forcing the variable to become uppercase.


1  Dim pieces As Integer

2  Public Property Pieces() As String
3  Get

4  Return pieces
5  End Get

6 Set (ByVal values As String)
7   pieces=value
8 End Set
9 End Property

Redirect to Security Questions if Site accessed from unrecognized computer?


I'm fairly new to ASP.NET and i'm using the Membership Provider.  I have the need to do similar to some banking sites. Baically I need to track "authorized" computers/ip's for a user.  If the user accesses the site form a recognized Computer/IP then the user is allowed into the app after successful login.  If the computer/IP is not recognized I need to redirect them to a screen to answer the security question setup in fhte Membership Provider.

Has anyone done anything like this or can anyone point me to any examples?  I did a search, but can't seem to find anything.

My idea is to maintain a list of authorized computers/IP addresses and check them on initial login.  If the IP address isn't found I can redirect them to the questions.  My concern is that they are then actually authenticated and could enter any of the site URL's as an authenticated user.

Any suggestions greatly appreciated. 

This forum is ONLY for accessibility questions about the physically challenged

Nothing more. A mistake was made when changing the description of the forum when adding the 2010 information.
FAQ sites: (SP 2010) http://wssv4faq.mindsharp.com; (v3) http://wssv3faq.mindsharp.com and (WSS 2.0) http://wssv2faq.mindsharp.com
Complete Book Lists (incl. foreign language) on each site.

get edited value from detailsview


hi sir/madam,

im using asp.net 3.5 sp1 and tried to search the internet but could not find any answer, i have a problem with detailsview as below, when user click on btnEdit, it will call detailsview.changemode(edit) and then allow user to enter data into the textbox, after that user will click on btnsave and then to read the value from txtname and process the value. my question is how do i get the value from txtname? i dont want to use any datasource component and i have tried call the DetailsView1.FindControl("txtname") and it returned txtbox with empty text. hope your can give me some clue where did i missed out.

any helps will be appreciated, thanks.

      <asp:DetailsView ID="DetailsView1" runat="server"  Height="50px" Width="125px" >
<asp:TextBox ID="txtname" runat="server" Text='<%# Bind("name") %>'></asp:TextBox>
<asp:Button ID="btnEdit" runat="server" Text="

Detailsview clears filled in fields


I have a details view on my page that has a template field in it. In the template field is a button that when clicked, sets the visible property of another field to true. When this happens the whole detailsview resets and anything that was entered into other fiields is cleared. Is there any way to prevent the other fields from being cleared when the hidden field is set to be shown. 

what am i doing wrong with this objectdatasource that the DetailsView never gets populated


I want to allow the user to view and edit their information.

So using another example i found online, i got it work, but the example was setup for you to provide the user name and search for the person, since you are already logged into the system i want to pass your username into the code so that on page load the DetailView is populated with your details.

                      <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="UserName" DataSourceID="ObjectDataSource2" Width="400px">
                                <asp:BoundField DataField="PasswordQuestion" HeaderText="PasswordQuestion" ReadOnly="True" SortExpression="PasswordQuestion" />
                                <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName" />
                                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                <asp:BoundField DataField="CreationDate" HeaderText="CreationDate" ReadOnly="True" SortExpression="Cre

Weird problem in Detailsview - Dropdownlist in



I'm new in this forum and I really hope you'll be able to help me.

I converted a field in the detailsview into a template field and put a dropdownlist in the <InsertItemTemplate> and it worked great. This is the code I put:

<InsertItemTemplate><asp:DropDownList runat="server" DataSourceID="sdsGenresPossible" DataTextField="Genre"  DataValueField="Index" SelectedValue='<%# Bind("Genre") %>' ></asp:DropDownList></InsertItemTemplate>

Now, I tried to do the same thing for the <EditItemTemplate> . This is the code I put there:

<EditItemTemplate><asp:DropDownList runat="server" DataSourceID="sdsGenresPossible" DataTextField="Genre" DataValueField="Index" SelectedValue='<%# Bind("Genre") %>' ></asp:DropDownList></EditItemTemplate>  

When I change the DV properties I do see that a dropdownlist was  added but when I run the program and click on "Edit" in the DV nothing happens (however when I click on "Insert" it works fine).

This is the Select command for the data source I used:

<asp:SqlDataSource runat="server"

Entities Framework 4 Questions


1. Do you have to setup cascading on the SQL server also, or if you setup Cascading in EF 4 that will do it for you, and you can keep Cascading in SQL not setup?

2. Is there any problems I should be aware of like the problems(yet manual fixble) with  using Cascading in EF 4 , MVC 2, SQL 2005.


Thanks :)



Windows Presentation Foundation (WPF) questions

This forum is for the WPF Designer ("Cider") in Visual Studio. If you have questions about WPF or using the WPF runtime then the WPF forum http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1 is probably a better place to ask your question. mark

web services interview questions.

Hi ,   I am preparing for ASP.NET web service interview.   Can you please send me the FAQ for web services.???   Thanks in advance.   Thanks Narendraan.K
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend