Re: Weird LinkButton!
- From: "Shivakumar" <shiva@xxxxxxxxxxxx>
- Date: Wed, 16 Nov 2005 22:05:48 +0530
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.
>>
>>
>
>
.
- Follow-Ups:
- Re: Weird LinkButton!
- From: Jay Douglas
- Re: Weird LinkButton!
- References:
- Weird LinkButton!
- From: Shivakumar
- Re: Weird LinkButton!
- From: Jay Douglas
- Weird LinkButton!
- Prev by Date: Re: Search engines and asp.net sites
- Next by Date: Internal Server Error
- Previous by thread: Re: Weird LinkButton!
- Next by thread: Re: Weird LinkButton!
- Index(es):
Relevant Pages
|