Click here to Skip to main content
15,904,653 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to make Plugins in asp.net ? Pin
Piyush Vardhan Singh8-Jan-09 18:24
Piyush Vardhan Singh8-Jan-09 18:24 
AnswerRe: How to make Plugins in asp.net ? Pin
Abhijit Jana8-Jan-09 19:17
professionalAbhijit Jana8-Jan-09 19:17 
GeneralRe: How to make Plugins in asp.net ? Pin
Piyush Vardhan Singh8-Jan-09 19:42
Piyush Vardhan Singh8-Jan-09 19:42 
QuestionHi....drag and drop Pin
madancode8-Jan-09 18:02
madancode8-Jan-09 18:02 
QuestionProblem encrypt connection strings in web.config Pin
alyy04068-Jan-09 17:46
alyy04068-Jan-09 17:46 
Questionhow do I read a file name located in a specific folder into a C# app Pin
Tina P8-Jan-09 17:27
Tina P8-Jan-09 17:27 
AnswerRe: how do I read a file name located in a specific folder into a C# app Pin
Tina P8-Jan-09 18:12
Tina P8-Jan-09 18:12 
QuestionSet Listbox scroll position after Postback Pin
dsrao8-Jan-09 15:58
dsrao8-Jan-09 15:58 
Hi All,

I have a muti-select listbox on my web form. When you scroll down to select items and SelectIndexChanged event fires, the postback brings the listbox back to the top of the screen. The item is still selected, but you have to scroll down to see it. How do I get the listbox to show one of the currently selected items.

Below is the my code..
aspx page
]]>
<asp:panel id="PanelContent5" runat="server" skinid="cpanelcontent" width="99.7%" xmlns:asp="#unknown">
<asp:updatepanel id="updpanelComparisonHospital" runat="server" updatemode="Conditional">
<triggers><asp:asyncpostbacktrigger controlid="cmdCustomList">
<contenttemplate>
<asp:listbox id="cmdCustomList" runat="server" selectionmode="Multiple" height="70px">
AutoPostBack="true" Width="150px" OnSelectedIndexChanged="cmdCustomList_SelectedInde xChanged">




client script


fuction CustomSelect()
{

Var SMIndex = document.getElementById('ctl00_ContentPlaceHolder1 _cmdCustomList');
for(var index = 0; index < SMIndex.options.length; index++)
{
if (SMIndex.options[index].selected) {

SMIndex.options[index].selected = true;

}
}
}


Code behind


protected void cmdCustomList_SelectedIndexChanged(object sender, EventArgs e)

int cntSelected = 0;
string scriptBlock = "CustomSelect();";

try
{
if (cmdCustomList.SelectedIndex > -1)
{
for (int indx = 0; indx<cmdcustomlist.items.count;>{
if (cmdCustomList.Items[indx].Selected == true)
{
values = values + "," + cmdCustomList.Items[indx].Value;
cntSelected++;
}
}
Session["lstCompHosp"] = values;

if (chkComparisonExcludeOnly.Checked == false)
{
if (cntSelected == cmdCustomList.Items.Count)
scriptBlock = "cmdAllAvailHosp();" // Another Client side function
}

updpanelComparisonHospital.Update();
ScriptManager.RegisterStartupScript(this, typeof(DefaultView), "cmdCustom", scriptBlock, true);
}
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}

}

Would you please give some directions.

Thanks
Rao

Thanks & Regards
Rao

AnswerRe: Set Listbox scroll position after Postback Pin
Rajdev Ramasamy12-Jan-09 2:49
Rajdev Ramasamy12-Jan-09 2:49 
QuestionHyperlink in a TextBox - Possible? Pin
kavitha_blueindia8-Jan-09 13:31
kavitha_blueindia8-Jan-09 13:31 
AnswerRe: Hyperlink in a TextBox - Possible? Pin
Not Active8-Jan-09 17:13
mentorNot Active8-Jan-09 17:13 
AnswerRe: Hyperlink in a TextBox - Possible? Pin
Rajdev Ramasamy12-Jan-09 2:11
Rajdev Ramasamy12-Jan-09 2:11 
QuestionHelp on ecommerce web programming Pin
atplerry8-Jan-09 13:02
atplerry8-Jan-09 13:02 
AnswerRe: Help on ecommerce web programming Pin
Not Active8-Jan-09 17:19
mentorNot Active8-Jan-09 17:19 
GeneralRe: Help on ecommerce web programming Pin
atplerry12-Jan-09 0:37
atplerry12-Jan-09 0:37 
QuestionWhy does web.config automatically save itself? Pin
Tomz_KV8-Jan-09 10:06
Tomz_KV8-Jan-09 10:06 
AnswerRe: Why does web.config automatically save itself? Pin
Jon Rista8-Jan-09 10:18
Jon Rista8-Jan-09 10:18 
QuestionBest third party components suite for Asp.Net Ajax Pin
lotuzwine8-Jan-09 9:57
lotuzwine8-Jan-09 9:57 
AnswerRe: Best third party components suite for Asp.Net Ajax Pin
ToddHileHoffer8-Jan-09 10:19
ToddHileHoffer8-Jan-09 10:19 
GeneralRe: Best third party components suite for Asp.Net Ajax Pin
lotuzwine9-Jan-09 1:40
lotuzwine9-Jan-09 1:40 
QuestionSaving data from a placeholder control [modified] Pin
AllPhee8-Jan-09 4:41
AllPhee8-Jan-09 4:41 
AnswerRe: Saving data from a placeholder control Pin
Not Active8-Jan-09 5:35
mentorNot Active8-Jan-09 5:35 
GeneralRe: Saving data from a placeholder control Pin
ToddHileHoffer8-Jan-09 6:06
ToddHileHoffer8-Jan-09 6:06 
GeneralRe: Saving data from a placeholder control Pin
AllPhee9-Jan-09 1:01
AllPhee9-Jan-09 1:01 
QuestionGive permision for ActiveX control Pin
hemant.kaushal8-Jan-09 2:56
hemant.kaushal8-Jan-09 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.