Re: Weird LinkButton!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



jay,
Am using the command name of the datagrid.
<asp:LinkButton runat="server" ForeColor="#FF6633" Text='Publish'
ID="Linkbutton1" NAME="Label1" CommandName="Edit" CommandArgument='<%#
GetURL(Container,"Publish") %>'></asp:LinkButton>

GetURL has the following
--------------------------
case "Publish":

if( (DataBinder.Eval(Container, "DataItem.StatusCode")).ToString()=="100")

URL="Publish"+"|"+DataBinder.Eval(Container, "DataItem.ModuleID");

break;


and the edit command has the following code.
------------------------------------------------
protected void dgScreenDetails_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)

{

string splitString = e.CommandArgument.ToString();

string[] arrCommandArgument = splitString.Split('|');

if (arrCommandArgument[0].ToString() == "Publish")

{

ModuleListingGeneralFunctions.PublishModule(arrCommandArgument[1].ToString());

BindDataToGrid();

}

}

NB: this code works fine when run in the local machine but throws javascript
error only when accessed from some other machine

Regards,

Shiva.


"Jay Douglas" <jayREMOVEIFNOTSPAM@xxxxxxxxxxxxxx> wrote in message
news:O06bljs6FHA.2676@xxxxxxxxxxxxxxxxxxxxxxx
> Are you running the Item event of the datagrid using a CommandName or the
> click event on the link button?
>
> One trouble shooting step could be re-adding the link button.
>
> --
> Jay Douglas
> http://www.jaydouglas.com
>
>
> "Shivakumar" <shiva@xxxxxxxxxxxx> wrote in message
> news:%23ZiW3Ts6FHA.1720@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi all,
>> Recently i have updated my vs.net 2003 project to vs.net 2005 and i
>> have successfully converted my code and found no problem with all my
>> controls except the one which is the linkbutton.
>>
>> I have added the linkbutton control in my datagrid and it rendered
>> perfectly but whenever i clicked the linkbutton am getting this error
>>
>> 'event' is null or not an object.
>>
>> I have checked with all the possibilities like using aspnet_regiis -i and
>> aspnet_regiis -c etc., and all my other controls like button, hyperlink
>> and all my javascripts work fine.
>>
>> I have used Scott Mitchell's skmlinkbutton, so i thought that would be
>> having some problem, so i removed that control and put microsoft's built
>> in linkbutton control and for my surprise am getting the same error. i
>> checked with the rendered javascript function which is in the following
>> format.
>>
>>
>> javascript:WebForm_DoPostBackWithOptions(new
>> WebForm_PostBackOptions("dgScreenDetails:_ctl6:nlnDelete", "", true, "",
>> "", false, true))
>>
>> i didnt understand what this script says(i mean parameters) and i
>> compared with some other script and found the target page is not
>> rendered. but still i couldnt able to find out the exact reason for this
>> error. can anyone please do help to solve this issue coz my whole project
>> got stuck because of this simple javascript error.
>>
>> Microsoft guys please do help me!.
>>
>> Thanks in advance,
>> Shiva.
>>
>>
>
>


.



Relevant Pages

  • Re: Weird LinkButton!
    ... Does the /wwwroot folder have the 2.0 aspnet_client javascript? ... > Am using the command name of the datagrid. ... > and the edit command has the following code. ... >> Jay Douglas ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Weird LinkButton!
    ... Are you running the Item event of the datagrid using a CommandName or the ... so i removed that control and put microsoft's built ... > in linkbutton control and for my surprise am getting the same error. ... > because of this simple javascript error. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IPostBackDataHandler not working properly with DataGrid
    ... Your code snippet worked like a charm. ... the user control nested in a datagrid. ... Only command events are raised and exposed ... public virtual void RaisePostDataChangedEvent() ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Multiple table in dataset query
    ... Here is some information on placing a combobox into a datagrid in .Net 1.1: ... a new parameterized query for the update and insert command which is then ... Private Sub frmStaff_Load(ByVal sender As System.Object, ... Dim dcConn as New OleDB.OleDbConnection("Integrated Security=SSPI;Packet ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Itemcommand event uses wrong comand
    ... and used an EditCommandColumn to get ... Handles property for each command. ... It does edit mode fine, ... "Edit"), and when I click Cancel, it removes the row from the datagrid. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)