Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
AnswerRe: datagird/com_box Pin
goyal manish3-May-06 2:09
goyal manish3-May-06 2:09 
QuestionHow to call a Page as an object in a method?? Pin
ryanchopps3-May-06 0:50
ryanchopps3-May-06 0:50 
AnswerRe: How to call a Page as an object in a method?? Pin
Guffa3-May-06 3:42
Guffa3-May-06 3:42 
GeneralRe: How to call a Page as an object in a method?? Pin
ryanchopps3-May-06 4:03
ryanchopps3-May-06 4:03 
AnswerRe: How to call a Page as an object in a method?? Pin
Guffa3-May-06 11:22
Guffa3-May-06 11:22 
QuestionHow to Connect to Dominos server from MS Outlook?? Pin
Bijon Roy3-May-06 0:43
Bijon Roy3-May-06 0:43 
AnswerRe: How to Connect to Dominos server from MS Outlook?? Pin
Daniele Ferrero3-May-06 4:20
Daniele Ferrero3-May-06 4:20 
QuestionHow to call a Page as an object in a method?? Pin
ryanchopps3-May-06 0:39
ryanchopps3-May-06 0:39 
Hi all,

I converted some VB code to C# for the purpose of setting a default button for a text box. The method has no reported errors but when i try and call the method i get the following error:

'Item_search' is a 'type' but is used like a 'variable'

I've tried calling the method in the following ways:

//Item_search is the name of the page (Item_search.aspx)
1: DefaultButton(Item_search, tb_item_description, btn_search);

2: Item_search page = new Item_search();
DefaultButton(page, tb_item_description, btn_search);

//Method for default button
public void DefaultButton( ref System.Web.UI.Page Page, ref TextBox objTextControl, ref Button objDefaultButton)
{
System.Text.StringBuilder sScript = new System.Text.StringBuilder();
sScript.Append("" );
sScript.Append("function fnTrapKD(btn){");
sScript.Append(" if (document.all){");
sScript.Append(" if (event.keyCode == 13)");
sScript.Append(" { ");
sScript.Append(" event.returnValue=false;");
sScript.Append(" event.cancel = true;");
sScript.Append(" btn.click();");
sScript.Append(" } ");
sScript.Append(" } ");
sScript.Append("}");
sScript.Append("");
objTextControl.Attributes.Add("onkeydown", "fnTrapKD(document.all." + objDefaultButton.ClientID + ")");
Page.RegisterStartupScript("ForceDefaultToScript", sScript.ToString());
}

Any help would be great Smile | :)
AnswerRe: How to call a Page as an object in a method?? Pin
alexey N3-May-06 0:45
alexey N3-May-06 0:45 
GeneralRe: How to call a Page as an object in a method?? Pin
ryanchopps3-May-06 3:32
ryanchopps3-May-06 3:32 
QuestionHow to handle the mouse pointer using c# Pin
ranandbe3-May-06 0:06
ranandbe3-May-06 0:06 
AnswerRe: How to handle the mouse pointer using c# Pin
alexey N3-May-06 0:31
alexey N3-May-06 0:31 
AnswerRe: How to handle the mouse pointer using c# Pin
ranandbe3-May-06 0:37
ranandbe3-May-06 0:37 
QuestionHow to attach context menu to array of controls? Pin
Kranti12519842-May-06 23:30
Kranti12519842-May-06 23:30 
QuestionHow to get font from a winForm control of another application? Pin
snowborderjiang2-May-06 23:23
snowborderjiang2-May-06 23:23 
AnswerRe: How to get font from a winForm control of another application? Pin
alexey N2-May-06 23:28
alexey N2-May-06 23:28 
GeneralRe: How to get font from a winForm control of another application? Pin
snowborderjiang3-May-06 16:37
snowborderjiang3-May-06 16:37 
QuestionFile Hiding Pin
Prashant Gadhave2-May-06 23:23
Prashant Gadhave2-May-06 23:23 
AnswerRe: File Hiding Pin
J4amieC3-May-06 0:16
J4amieC3-May-06 0:16 
GeneralRe: File Hiding Pin
Travis D. Mathison3-May-06 3:03
Travis D. Mathison3-May-06 3:03 
QuestionReources Pin
V.2-May-06 22:12
professionalV.2-May-06 22:12 
AnswerRe: Reources Pin
Travis D. Mathison3-May-06 2:44
Travis D. Mathison3-May-06 2:44 
GeneralRe: Reources Pin
V.3-May-06 3:29
professionalV.3-May-06 3:29 
GeneralRe: Reources Pin
Travis D. Mathison3-May-06 3:45
Travis D. Mathison3-May-06 3:45 
GeneralRe: Reources Pin
V.3-May-06 3:58
professionalV.3-May-06 3:58 

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.