Please tell me how I can implement Model Popup window on Contact Form
You can use jQuery Modal Plugins
Here is a nice article to show modal in ASP.NET
Smum County Modal Form for ASP.NET
Which contact form ? If its your custom form, use this function to show it as modal window:
http://msdn.microsoft.com/en-us/library/ms536759(v=vs.85).aspx
Easiest would probably be the jQuery popup plugin.. I've used it with some success.
<script type="text/javascript">
function openContactForm(){
var win = window.open('contactus.aspx','Contact Us','width=200,height=100');
}
</script>
Contact Us
for more options see this page.
Related
I am working on Windows 8 App where I need to show a web page with facebook "Like/Unlike" options. Below is code which I added for Like.I need to add Unlike option too. Can some one explain me how to get this done ?
#section AdditionalHeaderContent {
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
}
#section ContentFooter
{
<div id="fb-root">
<fb:like ref="#Url.RequestContext.HttpContext.Request.Url.ToString().EnsureTrailing("/")" show_faces="true" width="450"></fb:like>
</div>
}
How can I show "unlike" button?
Thanks.
The Facebook like button also is your Facebook unlike button. The Facebook button knows if you already liked the page.
So when you click on it again you are "unlike-ing" it again.
*update * *(so you do not have to check the comments)*
This button uses Javascript that has been hosted by facebook, you can not edit that.
----- What you can do ----
If it is possible to make a custom separate Like and "Unlike" button this would be the way to do it.
Use the c# Facebook SDK to code things for Facebook yourself.
( http://csharpsdk.org/ )
You can look up the Facebook API here.
( https://developers.facebook.com/docs/reference/apis/ )
I have a system and I had a problem today, when the user double-click on button control and the system process the operation twice.
I found a solution with this code on the button:
OnClientClick = "this.disabled = true; this.value = 'submiting ...';" UseSubmitBehavior = "false"
However, I have several pages in the system, with several buttons ... is there any way to set these attributes to all the buttons of the application?
Thank you!
What about using a clientSide approach by using JQuery and disabling all Submit controls (jsfiddle)
$(document).ready(function () {
$(' :submit').click(function (event) {
$(this).attr("disabled","true");
});
});
I am quite new to JQuery so if there are any better solutions or I am completly wrong, pls let me know!
I'm not sure, but it seems that it is possible through skin file.
You can create a custom button. Here you have example how to create button that displays confirm window on client click. Almost what you wan't.
http://dhavalupadhyaya.wordpress.com/2008/07/20/creating-custom-controls-in-asp-net/
Than you would have to change all the asp:Buttons on every page to someTag:YourButton. Maybe simple Find/Replace. But I think there is possibility to configure in web.config so that ASP.NET uses someTag:YourButton everytime it sees asp:Button. But can't find now how to do it.
Is there a way to open a page in XHTML without using <a href="page.html" target="_blank"> that is standards compliant?
I'm not using frames, but there are some pages that I want to open in a new window instead of the current one.
You can use javascript's window.open() method. However this could easily be blocked by a pop-up blocker. Why do you not want to use the "_blank" target?
You can use something like this:
My Page
And then you run this jQuery:
$(document).ready(function() {
$('a[rel="external"]').attr('target', '_blank');
});
This will add the target="blank" to the links and make your HTML validate :)
Most pop-up blockers wont block a pop up that has been requested by the user e.g you click a link and it pops up a window. IF you add an onlick event to your link and a target, the desired effect will work even if JS is turned off although you don't want to use target="_blank"
I have used jquery datepicker in my .aspx page. The control is working fine. What i need is to disable the control if the textbox on which it is linked is disabled. For ex. I am showing datepicker on textbox "txtDateOfAssignment". If the Enabled property of this textbox is false then datepicker should not be active on that.
Anybody have an idea?
Thanks in advance.
if you look at the documentation you'll notice that there is a "disable" method, so you can do :
$('id-of-your-textbox').datepicker('disable');
Ok, finally you're not using jquery-UI but jquery-datepicker, so it should be more something like as referred to the documentation here
$(document).ready(function () {
$('.date-picker').dpSetDisabled(true);
});
If you want to disable only 1 datepicker dont use the class selector ".date-picker" but the id of the datepicker you want to disable.
Another possible Solution is
var j$=jQuery.noConflict();
j$("#inputTextID").datepicker(('disable' ));
j$("#inputTextID").datepicker(('enable' ));
VB has a function InputBox() that will prompt the user to enter a single value, then click OK.
Is there a parallel functionality in ASP.NET, that will get the browser to pop up some kind of input box to return a single value?
If not, how do you recommend I achieve this effect?
You can do this in JavaScript
var result = prompt("Question", "Default text");
document.getElementById("HiddenInputBox").value = result;
document.HiddenForm.submit();
But most web apps seem to use of screen forms and simulated modal dialogs (fade and disable rest of screen)
jQuery is your friend for this, try simplemodal
For more functionality, check out the asp.net ajax control toolkit, and specifically the modal popup box control.
http://www.asp.net/ajax/
Yes - use the prompt() javascript function.
var x = prompt("enter a value");