Click here to Skip to main content
15,887,296 members
Home / Discussions / C#
   

C#

 
QuestionCreate an application which send forms through google docs and download results Pin
pinifg24-Jan-12 1:37
pinifg24-Jan-12 1:37 
AnswerRe: Create an application which send forms through google docs and download results Pin
Pete O'Hanlon24-Jan-12 1:42
mvePete O'Hanlon24-Jan-12 1:42 
GeneralRe: Create an application which send forms through google docs and download results Pin
pinifg24-Jan-12 1:52
pinifg24-Jan-12 1:52 
GeneralRe: Create an application which send forms through google docs and download results Pin
Pete O'Hanlon24-Jan-12 2:13
mvePete O'Hanlon24-Jan-12 2:13 
GeneralRe: Create an application which send forms through google docs and download results Pin
pinifg24-Jan-12 2:14
pinifg24-Jan-12 2:14 
GeneralRe: Create an application which send forms through google docs and download results Pin
Pete O'Hanlon24-Jan-12 2:20
mvePete O'Hanlon24-Jan-12 2:20 
QuestionHow to fix the position of a scroll bar....after selecting a row in grid view in an asp.net page Pin
rake6224-Jan-12 0:40
rake6224-Jan-12 0:40 
AnswerRe: How to fix the position of a scroll bar....after selecting a row in grid view in an asp.net page Pin
V.24-Jan-12 3:59
professionalV.24-Jan-12 3:59 
This is what I did and it works:

You have a hidden control calls vertscrollpossition and a panel called panel_contents.

This is the code behind:
private void SetScrollPosition(){
	string script;
	ClientScriptManager CSManager = Page.ClientScript;
	if(!CSManager.IsOnSubmitStatementRegistered(this.GetType(),"SaveScrollPosition")){
		script = "var HiddenField = document.getElementById('" + vertscrollposition.ClientID + "');\n\r";
		script += "var ScrollElement = document.getElementById('" +	panel_contents.ClientID + "');\n\r";
		script += "HiddenField.value = ScrollElement.scrollTop;\n\r";
		CSManager.RegisterOnSubmitStatement(this.GetType(), "SaveScrollPosition",script);
	}									//end if
	if(!CSManager.IsStartupScriptRegistered(this.GetType(),"RetrieveScrollPosition")){
		script = "var HiddenField = document.getElementById('" + vertscrollposition.ClientID + "');\n\r";
		script += "var ScrollElement = document.getElementById('" + panel_contents.ClientID + "');\n\r";
		script += "if(HiddenField.value != '')\n\r";
		script += "{\n\r";
		script += "ScrollElement.scrollTop = HiddenField.value;\n\r";
		script += "}\n\r";
		CSManager.RegisterStartupScript(this.GetType(), "RetrieveScrollPosition",script, true);
	}									//end if
}


This is the aspx code:
<asp:Panel ID="panel_contents" Height="175" Width="800" runat="server" ScrollBars="Vertical" ViewStateMode="Enabled" EnableViewState="True">
</asp:Panel>
<asp:HiddenField ID="vertscrollposition" runat="server" />

V.

AnswerRe: How to fix the position of a scroll bar....after selecting a row in grid view in an asp.net page Pin
ZurdoDev24-Jan-12 10:56
professionalZurdoDev24-Jan-12 10:56 
QuestionProblem connecting to MySQL Pin
Jassim Rahma24-Jan-12 0:03
Jassim Rahma24-Jan-12 0:03 
AnswerRe: Problem connecting to MySQL Pin
Luc Pattyn24-Jan-12 0:35
sitebuilderLuc Pattyn24-Jan-12 0:35 
GeneralRe: Problem connecting to MySQL Pin
Jassim Rahma24-Jan-12 5:03
Jassim Rahma24-Jan-12 5:03 
GeneralRe: Problem connecting to MySQL Pin
Matt Meyer24-Jan-12 5:18
Matt Meyer24-Jan-12 5:18 
GeneralRe: Problem connecting to MySQL Pin
Jassim Rahma24-Jan-12 5:22
Jassim Rahma24-Jan-12 5:22 
QuestionSqlConnection in encrypted file Pin
Jassim Rahma23-Jan-12 21:44
Jassim Rahma23-Jan-12 21:44 
AnswerRe: SqlConnection in encrypted file Pin
Pete O'Hanlon23-Jan-12 22:18
mvePete O'Hanlon23-Jan-12 22:18 
GeneralRe: SqlConnection in encrypted file Pin
thatraja23-Jan-12 22:27
professionalthatraja23-Jan-12 22:27 
Questionprogrammatically change datagridviewbutton text property Pin
Mr.Kode23-Jan-12 14:03
Mr.Kode23-Jan-12 14:03 
AnswerRe: programmatically change datagridviewbutton text property Pin
Richard MacCutchan23-Jan-12 23:23
mveRichard MacCutchan23-Jan-12 23:23 
Questionxaml page as resource Pin
Giorgi Nistor23-Jan-12 4:50
Giorgi Nistor23-Jan-12 4:50 
AnswerRe: xaml page as resource Pin
dexterama23-Jan-12 5:55
professionaldexterama23-Jan-12 5:55 
GeneralRe: xaml page as resource Pin
Giorgi Nistor23-Jan-12 6:24
Giorgi Nistor23-Jan-12 6:24 
Questionrun the batch file code in C# Pin
Member 853472622-Jan-12 23:47
Member 853472622-Jan-12 23:47 
AnswerRe: run the batch file code in C# Pin
Richard MacCutchan22-Jan-12 23:50
mveRichard MacCutchan22-Jan-12 23:50 
AnswerRe: run the batch file code in C# PinPopular
phil.o23-Jan-12 3:19
professionalphil.o23-Jan-12 3:19 

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.