ASP.Net Remove Sidebar from Wizard Control - c#

Any ideas how to remove/hide/disable and make invisible the sidebar (with all of the links in it) from a Wizard Control?
Cheers.

You can achieve this using the Wizard.DisplaySideBar Property like so:
<asp:Wizard ID="wizard1" runat="server" DisplaySideBar="false">...

You can find it in:
Wizard properties.
highlight the .aspx form code then look for it in behavior.
click Image where to find it

Related

Create Dynamic Dragable images in ASP.NET c# using jquery

I am trying to create on the fly when i click a button in my ASPX page. I need to apply dragable property to the dynamically generated images. How can I go about it.? Jquery or AJAX.? How to apply the dragable property to every dynamically created images.
Use jqueryUI to make the images dragable. It is very simple.
$('img').draggable().click(function(){
alert('click event');
});
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
Go to this site for more information. http://jqueryui.com/draggable/
See the following jsfiddle for example. http://jsfiddle.net/Doinkmeister/Rtwcj/
Just make all the images draggable.
$('img').draggable();
You can check this posts-
http://delicious.com/anupdg/draggable+database
Regards
Anup

Creating an on hover effect with my ASP.net Menu control

My question: How to create an on hover effect with for my ASP.net menu.
The problem is that since the standard ASP.net menu doesnt have an on hover function, its quite hard/impossible(?) to create.
After doing my homework i saw some people who tried it with css, jquery and other methods... but i would prefer 'normal' html or css without incredibly complicated solutions.
Should that really be impossible, is there any clear way how to use it?
Most of the css options failed, or were incredibly complicated.
What exactly should happen:
A menu item for example
<asp:MenuItem NavigateUrl="~/Pages/Test.aspx" Text="Test" Value="Test" Selectable="true"></asp:MenuItem>
Should get a different background because of on hover effect.
Maybe changing the CSS from within the C# code into something else?
Thanks for your answer!
~Solved~
Thank you very much for your help! The problem is solved thanks to both of the answers.
I tried inplementing that menu, when i noticed that in this menu the hover effect also didnt work. What was the problem? I use 2 css files. And because the first css file contained some instruction as to how to handle the a:hover, all of the other hover effects were ignored.
Now that i know why the hover effect wasnt working, i can solve this problem. Thank you both very much!
Alright guys, it took me quite some time to figure out how to create the on hover effect with the ASP.net menu. So, i found an easy way, without all the hard stuff or lots of code.
If you look at your asp page in your browser, go to page source. When you look at your menu, you will notice that it looks like this:
<li>
<a class="level1" href="Home.aspx">
<img src="../Images/home.png" alt="" title="" class="icon" />Home</a></li>
<li>
<a class="level1" href="Page2.aspx">
<img src="../Images/homehover.png" alt="" title="" class="icon" />Page2</a><ul class="level2">
The solution would be to change your css:
a:hover[href*="Home"][class*="level1"]
{
color: black;
}
This piece of CSS selects the A element, where (in the HTML) the attributes href and class contain(or are equal to) Home and level1.
It might be a bit different if you have a more complex menu then i do, for i have just 2 levels deep. (menu and submenu)
Hope it helps you guys!
Then this is the end of my first question/answer on stackoverflow.
Thanks for your help!
ps: If it doesnt work, remove all a:hover statements in all related css files to the page with the menu. It might also be a problem if you use the StaticHoverStyle/DynamicHoverStyle.

How to add style to a image when you hover over it, in asp.net website

I have a image in my website, How can I add style to it so that it looks like a real button. now when I click it or move the mouse over it there is no changes to the image. when click or the mouse it over it how can I add style to it. Thanks
<asp:ImageButton ID="Img_ComposeMessage" PostBackUrl="~/SendMessage.aspx" ImageUrl="Styles/Images/ComposeMessage.png"
runat="server" />
Sounds like something you can easily accomplish with JavaScript / jQuery; just hook into the mouseover event and change the image then.
If you're worried about flash of unstyled content, you could switch to using css background/spriting for your image along with an asp:linkbutton instead of an asp:imagebutton
Here's a quick tutorial to get you started - http://www.learningjquery.com/2007/02/quick-tip-set-hover-class-for-anything
You have to use Javascript and/or CSS styling to change the ImageButtons properties.
Client Side javascript method calls can be added to the ImageButton's OnClientClick Property.
To ensure you have a static ID property on the control when rendered, for use with CSS effect or JQuery, use the ClientIDMode Property, set it to Static, the ID property you define with be rendered.

jquery context menu and asp update panel

i am using jquery context menu on a div inside an update panel. i read that i should be using ScriptManager.RegisterStartupScript to register the script, and that is what i did.
on partial post back the menu appears on the screen even without right clicking on the div. Moreover if i issued a right click on the div the contextMenu is launched as it normally would.
This sounds like just a styling issue, you need to specifyin your CSS that the contextMenu is hidden by default, otherwise it'll work, but also show up before you clicked to show it, which is what you describe.
If the menu is for example this:
<div class="contextMenu">.....</div>
Make sure you have corresponding CSS to hide it, like this:
.contextMenu { display: none; }
This will keep it hidden until you right click to show it :)

Open a new window with asp.net

Im new into that asp.net thing, but here goes.
I got at ImageButton, and when its clicked i want the image displayed in another window. If I can avoid using ajax i would like to do that.
If possible would like to make the window modal, but still avoid ajax, since Im not ready to mix more technolgies yet.
The existing answers with JavaScript are fine, but just to suggest an alternative - could you use a HyperLink (with an ImageUrl set so you still get an image) and set its Target property instead?
IMHO the best practice to show a picture is in the same page on the top of the content. I personally use Lightbox. You can find the documentation on their page, so it should be easy for you to integrate their JavaScript code.
Somewhat like this:
<asp:ImageButton ID="imbJoin" CssClass="btn-find" AlternateText="Find" ToolTip="Find" runat="server" ImageUrl="~/library/btn-find.gif" onClick="javascript:popUp("ServicesLocator.aspx")" />
Resource: http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22832169.html
Using the ImageButton you need to use a JavaScript to open it in a new window. You can also look into the OnClientClick-event
You can use the ImageButton's OnClientClick property:
<asp:ImageButton ... OnClientClick="javascript:window.open('url_to_image');" >
But this popup window will not be modal.
The following javascript will do what you're looking for:
window.open('page.html','WindowTitle','width=400,height=200')
It might be worth pointing to a two relevant entries in the excellent EFNet's #javascript FAQ:
Correct Use of Popups - yay accessibility!
How do I make a popup window the same size as my image?
How do I create a custom 'OK' dialog or something similar? - modal windows are not that useful and something like the suggested Lightbox or similar scripts would be better "modal" options
Correct Use of Links - this one being only partly on-topic but the previous answers use of the "javascript:" pseudo protocol made it necessary: it is never required nor useful in a web page that should work across browsers. After all, JavaScript is the default (and only) scripting language.
Thank you for all the answers! I ended up using lightbox
I found this example
http://neutrongenious.wordpress.com/2007/09/08/lightbox-for-asp-net-2-0/
And it works perfectly

Categories