Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

sbao004

@sbao004
About
Posts
9
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • get value from Gridview
    S sbao004

    I convered the image button in the Gridview into the Templet, and used the ImageButton1_Click event handler. I think because when you select the row, it will change the row index to "-1", which does not really exist in the GridView, By using: Session("OrderID") = Convert.ToString(CType(GridView2.Rows(GridView2.SelectedIndex).FindControl("Label4"), Label).Text) it keeps on throw me the error that "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" Otherwise if I use: Session("OrderID") = Convert.ToString(CType(GridView2.SelectedRow.FindControl("Label4"), Label).Text) It will say " Object reference not set to an instance of an object." So it just doesn't work. I don't know how to use these 2 properties. Can you please help? Thanks,

    Database question database help

  • get value from Gridview
    S sbao004

    Hi, I want to get the value of "OrderID", which is the first colum in the Gridview2, from the Gridview when a specific row is selected with hard coding. My code is: Session("OrderID") = Convert.ToString(CType(GridView2.Rows(GridView2.EditIndex).FindControl("Label4"), Label).Text) I've also tried to use GridView2.SelectedIndex, which always returns -1, which is an invaliad index value. or GridView2.SelectedRow.Cells(1).Text but it seems the SelectedRow is always nothing. So I don't know what is wrong with me. Can anyone help please? Thank you.

    Database question database help

  • Insert values into Listbox with Javascript
    S sbao004

    Hi Ashutosh, Sorry, I'm still not very clear about these codes Does it work the same for ListBox as well? So what is "states"? Is it a name of a talbe or a DataSet or something?

    Aashutoshkumar wrote:

    for (var i = 0; i < states.Tables[0].Rows.length; ++i)

    What about "StateName" and "StateId"? Are these some kind of a property or it will be the Name and ID of the DataSet?

    Aashutoshkumar wrote:

    document.getElementById("ddlState").options[document.getElementById("ddlState").options.length] = new Option(states.Tables[0].Rows[i].StateName, states.Tables[0].Rows[i].StateId);

    How about the "or" is it a part of the code or it's the next line of the code will do the same thing as the codes above, so it is another option for me?

    Aashutoshkumar wrote:

    or document.getElementById("ddlState").options[0] =value;

    Thank you for answering me. And sorry about the trouble, without understanding them I can not modify them and customise into my codes. Thanks again,

    ASP.NET javascript tutorial question

  • Insert values into Listbox with Javascript
    S sbao004

    Hi Ashutosh, Thank you for your reply. Can I please know what "ddlState" is? Is it the name of the Listbox I want to display the words, or the control that has the sentance? If it is the Listbox, where can I pass the sentance? And should I use something to split the sentance first? Thanks,

    ASP.NET javascript tutorial question

  • Insert values into Listbox with Javascript
    S sbao004

    Hi, I want to split a sentence and put each word into a row of ListBox by using Javascript. Does anyone know how to do that? Thanks,

    ASP.NET javascript tutorial question

  • Callback & passing value
    S sbao004

    Hi, I was trying to send a number from a HTML textbox to add a value to it at the Server, then return it to an ASP textbox. But I don't know to to pass the value of the HTML textbox to the server. The 2 Javascript functions are: //the first function to call the server function GetNumber() { UseCallBack(); } // The function receive the adjusted value from the server and display it into the textbox1 function GetRandomNumberFromServer(arg, context) { document.forms[0].TextBox1.value = arg; } Here are the server side code, written in the .vb file: Dim _callbackResult As String = Nothing Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim cbReference As String = Page.ClientScript.GetCallbackEventReference(Me, _ "arg", "GetRandomNumberFromServer", "context") Dim cbScript As String = "function UseCallBack(arg, context) {" & cbReference & "}" Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "UseCallBack", cbScript, True) End Sub Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult Return _callbackResult End Function Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent _callbackResult = 'equal the value from the HTML textbox + 5 End Sub Does anyone know where I can add some code to ask to pass the value to the Server? Thanks,

    ASP.NET javascript html design sysadmin question

  • Send a value through Callback to Server [modified]
    S sbao004

    Hi, I was trying to send a number from a HTML textbox to add a value to it at the Server, then return it to an ASP textbox. But I don't know to to pass the value of the HTML textbox to the server. The 2 Javascript functions are: //the first function to call the server function GetNumber() { UseCallBack(); } // The function receive the adjusted value from the server and display it into the textbox1 function GetRandomNumberFromServer(arg, context) { document.forms[0].TextBox1.value = arg; } Here are the server side code, written in the .vb file: Dim _callbackResult As String = Nothing Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim cbReference As String = Page.ClientScript.GetCallbackEventReference(Me, _ "arg", "GetRandomNumberFromServer", "context") Dim cbScript As String = "function UseCallBack(arg, context) {" & cbReference & "}" Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "UseCallBack", cbScript, True) End Sub Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult Return _callbackResult End Function Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent _callbackResult = 'equal the value from the HTML textbox + 5 End Sub Does anyone know where I can add some code to ask to pass the value to the Server? Thanks, -- modified at 4:30 Tuesday 3rd October, 2006

    ASP.NET javascript html design sysadmin question

  • Callback & Masterpage
    S sbao004

    Cool. Thank you so much After I View the source code during the runtime, I find the ID of the textbox. The ID of the textbox is "ctl00$ContentPlaceHolder1$TextBox1" The name of the textbox is just TextBox1 and the "ct100" I don't know what it means but it's just there. Just in case someone has the same problem with me. Cheers,

    ASP.NET javascript sysadmin question

  • Callback & Masterpage
    S sbao004

    Hi, I'm trying to use callback function to send a randon number to the client. My code works on a normal page, but not on a page with Masterpage. My JavaScript is: //To call the function in the Server function GetNumber() { UseCallBack(); } // To retrive the value from the server to display it in the TextBox1 function GetRandomNumberFromServer(arg, context) { document.cforms[0].TextBox1.value = arg; } So is there anything I should change? Thanks, Si Jia

    ASP.NET javascript sysadmin question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups