B
Brian
I would like to create a custom webpart verb that only calls client side
javascript. I created a custom WebpartVerb and added it to my zone's
collection via the following code:
ArrayList Arr = new ArrayList();
WebPartVerb v = new WebPartVerb("v1", "OnVerbClicked('" + this.ClientID +
"')");
v.Text = "Click me";
v.ImageUrl = "~/Images/down-b.gif";
Arr.Add(v);
e.Verbs = new WebPartVerbCollection(Arr);
(I am using the constructor which does not specify a server side method.)
The problem is that when this verb is rendered out to the client the anchor
tag has a __dopostback in the href field, like so:
<a onclick="OnVerbClicked('zone3');" href="javascript:__doPostBack('','')">
So after the client script is called an unnecessary postback is called.
Does anyone know how to prevent the href attribute from being rendered out?
The Verb control does not expose any properties which could help out.
Thanks
javascript. I created a custom WebpartVerb and added it to my zone's
collection via the following code:
ArrayList Arr = new ArrayList();
WebPartVerb v = new WebPartVerb("v1", "OnVerbClicked('" + this.ClientID +
"')");
v.Text = "Click me";
v.ImageUrl = "~/Images/down-b.gif";
Arr.Add(v);
e.Verbs = new WebPartVerbCollection(Arr);
(I am using the constructor which does not specify a server side method.)
The problem is that when this verb is rendered out to the client the anchor
tag has a __dopostback in the href field, like so:
<a onclick="OnVerbClicked('zone3');" href="javascript:__doPostBack('','')">
So after the client script is called an unnecessary postback is called.
Does anyone know how to prevent the href attribute from being rendered out?
The Verb control does not expose any properties which could help out.
Thanks