Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
NavigateUrl do an unwanted postback
posted

Hello,

I have a simple WebDataMenu and for some action I want a postback and other no postback

I use the NavigateURL property to define the new page

But in all cases, I alwaws have a postback

I don't want to disable postback for all item ans manage by myself the postback

Is there a way to do want I want ?

 

protected void Page_Load(object sender, EventArgs e)

        {

if (!IsPostBack)

            {

               

DataMenuItem rootItem = WebDataMenu1.Items.Add("Main menu", "Main");

               

DataMenuItem item1 = new DataMenuItem();

                item1.Text =

"NavigateUrl";

                item1.Value =

"ValSub1";

item1.NavigateUrl =

"http://www.microsoft.com";

                item1.Target =

"blank";

                rootItem.Items.Add(item1);

               

DataMenuItem item2 = new DataMenuItem();

                item2.Text =

"PostBack";

                item2.Value =

"ValSub2";

                item2.Key =

"ValSub2";

                rootItem.Items.Add(item2);

            }

        }

       

protected void ServerAction(object sender, DataMenuItemEventArgs e)

        {

        }

and aspx

       

function NoPostBack(sender, e) {

           

var itemMenu = e.getItem();

            alert(itemMenu.get_valueString());

           

if (itemMenu.get_valueString() == '')

                e.set_cancel(

true);

        }

 

       

<ig:WebDataMenu ID="WebDataMenu1" runat="server" Height="39px" Width="132px" OnItemClick="ServerAction">

           

<AutoPostBackFlags ItemClick="On" ItemSelected="Off" />

           

<GroupSettings Orientation="Horizontal" />

           

<ClientEvents ItemClick="NoPostBack" />

       

</ig:WebDataMenu>

 

Thank you very much for your help

 

Romain

Parents Reply Children
No Data