.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

C# ASP.NET Problem keeping scroll position SelectionMode="Multiple"

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Have tried numerous solutions and nothing has worked.  I'm pretty sure that Javascript is required to get this functional. Thanks for your help!    Here is the code for file Search.aspx ===BEGIN<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="search.aspx.cs" Inherits="SearchApp.search" MasterPageFile="~/Site1.Master" EnableViewState="true"%> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <fieldset> <legend style="text-align:center;"><b>Make Atleast one or multiple selections from one of the following categories</b></legend> <div class="wrapperserach"> <div> <div class="side-a"> County<asp:ListBox ID="Lcounty" runat="server" AutoPostBack="true" SelectionMode="Multiple" OnSelectedIndexChanged="Lcounty_SelectedIndexChanged" Width="140px"> <asp:ListItem value="1">Imperial</asp:ListItem>

View Complete Post

More Related Resource Links

setting scroll position for a ListBox


I have a ListBox control showing 10 rows.  I have 30 rows total in the listbox.  How do I programmatically adjust the scroll to show the last ten rows?

Some sources have suggested that I set the SelectedItem.  But I am already making selections (myListBox.Items[28].Selected = true, myListBox.Items[29].Selected = true, etc); the listbox scroll is positioned on Item[0] not the first selected item.  I have also tried setting myListBox.SelectedItem in addition to the multiple selection just mentioned but that does not have any affect either.


Multiple Submit Connection Problem


Hello everyone,

I have an InfoPath form with two Submit Connections. One of them is a regular submit connection to a SharePoint Document Library. The other is a submit connection to the UpdateListItems web Service.

I have one button using rules that submits the forms fields to the Document Library. Some of those fields have data validation rules like entry must be four digits, and field cannot be blank.

The other submit button uses rules to submit an XML template to the UpdateListItems Template. My problem is that even though this second button does not have the first submit connection as an action, the form will still check all of the forms fields to see if they violate the validation rules before it will submit to the Web Service.

How do I tell InfoPath to ignore the validation rules when I only want to submit to the Web Service? I want the user to be able to enter data into the XML template fields and submit to the Web Service, even if some of the rest of the fields are blank. Right now if any of the other fields fail validation it prevents submittal to the web service even if the fields that failed validation are not being submitted to the web service.

Thanks for any advice that can be offered,
Bill Hurt

LINQ query with multiple joins, problem


I am using a LINQ query with multiple joins, the last join does not return any values even though values exist in the database. Below is my code.

when the query returns suiteNameTrg and SuiteTypeTrg are empty, all other values are returned correctly.

string suiteNameTrg = string.Empty;
            string suiteTypeTrg = string.Empty;
            using (DataClassesDataContext db = new DataClassesDataContext())
                    var productQuery = from assets in db.ASSETs
                    join relocatableUnits in db.RELOCATABLE_UNITs on assets.RUID equals relocatableUnits.RUID into assets_units
                    from relocatableUnits in assets_units.DefaultIfEmpty()
                   join build in db.BUILDINGs on assets.BUILDING_ID equals build.BUILDING_ID into assets_bins
                   from build in assets_bins.DefaultIfEmpty()
                   join test in db.TEST_SUITEs on assets.TEST_SUITE_ID equals test.TEST_SUITE_ID into test_bins
                   from test in test_bins.DefaultIfEmpty()
                    join testTrgt in db.TEST_SUITEs on assets.TARGET_TEST_SUITE_ID equals testTrgt.TEST_SUITE_ID into testTrgt_bins
                    from testTrgt in testTrgt_bins.DefaultIfEmpty()

                    select new

Problem with ListView and SelectionMode="Single"

  I have the following XAML: <Grid>       <ListView SelectionMode="Single" Height="100" HorizontalAlignment="Left" Margin="26,118,0,0" Name="listBox1" VerticalAlignment="Top" Width="120">       <ListView.View>       <GridView>       <GridViewColumn Header="Test"/>       </GridView>       </ListView.View>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       <ListViewItem>Test</ListViewItem>       </ListView>       </Grid>       Just a stock ListView with SelectionMode="Single". Isn't SelectionMode="Single" supposed to be single selection mode? There seems to be a lot of weird stuff with the Ctrl-Key. I tested the same behavior in a standard W

people picker problem, with multiple select lose the list.

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> Hi guys I have a master table with configuration for reports. when I load a InfoPath form (2010) for new report I have a approvers that set ok  , and I have  Notifies (multiple people) when I load a value form master they left me in the field only the first value(people) and lose the others. Do you know if there any way to load a multiple people value in people picker control?   Thank in advance Ramiro

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

Problem: Sessions got mixed up when open multiple tab for a sigle application

We got a problem that Sessions got mixed up when open multiple tab in a single application. We could change the code that do not use session variable in a that level, but a tons of page need to be modified. We need to find a quick fix for this problem. Is any thing we can do in code level to prevent user open multiple tab in a single application? O any thing we can do to keep its own session for a single tab?

Problem with multiple UpdatePanelAnimationExtender

Dears, I have some updatepanels in my page each of which has a UpdatePanelAnimationExtender to fade controls during update process, But in each updatepanel partial postback all the UpdatePanelAnimationExtender and updatepanels(SOMETIMES) are fired. In all of updatepanel their children fire update method and they dont have any outside triggers. I tried Sys.WebForms.PageRequestManager.getInstance(); function but nothing changed. Here is my brief JS code of UpdatePanelAnimationExtenders:function onUpdating(obj) { switch (obj) { case 'EditJobsUpdatePanel': var updateProgressDiv = $get('CurrentJobupdateProgressDiv'); var mycontrol= $get('<%= this.GridView1.ClientID %>'); break; case 'NewJobUpdatePanel': var mycontrol= $get('<%= this.JobsDropDown.ClientID %>'); mycontrol.disabled = true; return; break; } updateProgressDiv.style.display = ''; SOME CODES; } function onUpdated(obj) { switch (obj) { case 'EditJobsUpdatePanel': var updateProgressDiv = $get('CurrentJobupdateProgressDiv');

C# Problem with multiple SerialDataRecieved event handlers

Hi all, I'm relatively new to C# and have no formal programming experience so apologies in advance if the way I do things are bad practice etc - I generally implement things in a way which seems logical to me! As a small project I'm making a toy car which can drive itself, the problem I've currently got is reading data from two serial port devices at once. The way I tend to work is to write smaller applications to do one function and get that working before integrating it into a larger application which will pull all the functions together. I've written a "Serial_Port_Communications" class which allows you to pass a serial port object into it and then perform some typical functions: open a port, close it, read data, write data etc. Thats common code across all of my serial devices (they all need to do the same operation so why re-write it?) Then for each device I've got a class which handles the operations and data specific to it: GPS & Compass. Each of those two create instances of the Serial_Port_Communications class. In the GPS & Compass classes, they each have a SerialPort object which has an eventhandler assigned to it for when data is received e.g GPS.datareceived += & Compass.datareceived +=... They each work flawlessly when they run as the mini-applications i.e. I can Parse the GPS data that is received and I can read

problem with pushpin position in Bing

Hello guys! I have the problem with pushpin's position in Bing Maps. I have published my project to server: http://sergylens.narod.ru/bing/TestPage.html Try it! See the pushpin? Try to go left or right on Map! See the position of pushpin has changed. It's not static at all like in SDK samples. The another problem is, that I can't add more , than one pushpin!!! My code is just: <m:Map x:Name="Map" CredentialsProvider="HereIsMyKey" Center="47.620574,-122.34942" /> <m:Pushpin x:Name="Pun1" Location="53.19335,50.18986" /> Location loc = new Location(53.19155, 50.19098); Map.SetView(loc, 11.0000); So , if in Xaml I shall add more pushpins. The last pushpin I have add always override the pervious one. Sample: Pushpin #1 - 43.434334 / 42.4234234 Pushpin #2 - 54.324234 / 46.4243242 Pushpin #3 - 95.423424 / 32.1231233   So the #2 override the #1, and than #3 override the #2 and finally I have seen only the last pushpin!!! Where are anothers? Code: <m:Pushpin x:Name="Pun1" Location="53.19335,50.18986" /> <m:Pushpin x:Name="Pun2" Location="53.11335,50.38986" /> <m:Pushpin x:Name="Pun3" Location="53.05335,50.08986" /> And I see only the Pun3!!! Where are Pun1 && Pun2 ??? So, my problems are: 1). Non-static position of pushpin ( yo

Document Set - Problem when uploading multiple files with "Launch forms in a dialog" disabled

Hello, Has anyone come across this before? I have a basic document library for which I have enabled "Allow management of content types" and disabled "Launch forms in a dialog".  Both of these settings are in the "Advanced Settings" page.  Also, the document library does not have versioning enabled and check out is not required. I added the OOTB "Document Set" content type to this document library and allowed OOTB "Document" content type documents in this document set.  This document set does not have any default content. The issue arises after I upload multiple files and click the "Done" button.  After I do this, the browser redirects to the top level of the site!  For example, if I uploaded to my document set at http://server/sites/anyname/doclib, I am redirected to http://server/. This issue has come up in both a standard server and an enterprise server. Steps to repeat issue: Create a document set Open the document set Select "Upload Multiple Documents" Drag and drop or browse for files Click "OK" Click "Done" Actually, this issue also occurs when "Launch forms in a dialog" is enabled.  In this case, you just have to navigate to the upload form directly (with all the necessary query string parameters, of course). Has anyone else seen this issu

Multiple Tables needed for Report Builder Problem


I have 3 tables I need to join: Voucher, Voucher_Detail, and Place
Voucher is related to Voucher_Detail by column voucher_run_id
Voucher has no relationship to Place
Voucher_Detail is related to Place by column place_id

I have solved the one to many relationship problem I was having between Voucher and Voucher_Detail by adding a New Named
Query called LeftOuterJoin.

In my DSV, the Voucher table links to the LeftOuterJoin which links to the Voucher_Detail which links to the Place

When I go into Report Builder, as soon as I select Voucher_Detail ( which is the table that has the most columns I need in the report),
the Voucher table disappears from view.

Not sure what I have missed. Obviously I need access to all 3 tables' data.

Problem Using Invoke and passing multiple byref parameters


I have code, shown below highly simplified that works all except for 1 thing: The variables being passed byRef get passed, but once modified in RecordData, they are never updated in the calling function. The calling function does not receive the updated data that is in the variables custid and amt. When debugging, I see the data in the else section of if me.invokerequired, but once it returns from the callback and is in the latter part of if me.invokerequired the data is missing.

How do I fix this?


Delegate Sub RecordDataCallback(ByRef custid As String, ByRef amt As Double)

Private Sub RecordData(ByRef custid As String, ByRef amt As Double)
    If Me.InvokeRequired Then

problem in selecting deslecting multiple records in grid view by clicking control key.plz help


i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {

problem in selecting deslecting multiple records in grid view by clicking control key through java


i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {

Wizard Scroll Position


I have a page that contains a asp:Wizard control.

I set MaintainScrollPositionOnPostback = true for the page.

When the wizard proceeds to the next step, the scroll position from the previous step is maintained.

How can I make the scroll position to be at the top for a new step? and maintain it when it postback to to same step (like when there are validation errors).


Problem with multiple extender


Hi there,


I'm having a problem with using multiple extenders acting on a single object. Basically, what I'm wanting to do is use the Modal Popup Extender AND the RoundedCornersExtender, both acting on the same panel. When I press on the button, the background "grays out", but the popup doesn't come up.



<form id="form1" runat="server">

<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">


<asp:Button ID="button1" runat="server" Text="Click me" />


<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"

CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="button1"

PopupControlID="Panel1" PopupDragHandleControlID="PopupHeader" Drag="True"




<asp:Panel ID="Panel1" runat="server" style="display:none"

Height="200px" Width="300px">

<div class = "popup_Container">

<div class = &qu

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