.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

change URL using javascript, but URL doesnt change

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :ASP.Net
I want to redirect a user to an url after he clicks a checkbox using javascript.I succeed at doing that using this code:<input id="partylocation" type="checkbox" onclick="javascript:location.href='www.domain.com/?q=party';" />HOWEVER: the URL remains the same! I need the URL to change accoding to the new domain.I also tried:<input id="partylocation" type="checkbox" onclick="javascript:window.location='www.domain.com/?q=party';" />

View Complete Post

More Related Resource Links

dropdownlist javascript change items


I can't find solution for this problem for very long time:

I have dropdownlists in Gridview. I need to dinamicly change content of dropdown on client with javascript. Ok, I know to do that. But the problem is when I send data to server changes in dropdownlist does not see. On server I have  old items. How can I change items in dropdown on client with javascript and than see that items on sever when postback data?


change form target from javascript


Salam to all,

in my page, i have an iframe which have a src for another page,

the inner page have a Forms, buttons.. ..etc. the target for the form in the inner page is "self"

i need to run a javascript code from the parent page to change the  inner page form target to posted the values in a Blank window.

how can i do that ?


Change RadMaskedTextBox value via javascript

Hi All,I am using RadMaskedTextBox in my web page. I am trying to set its value through javascript. It works ok if i hard-code control name (i.e. rtHours11_1) in the script as following: var radMaskedTextBox1 = window["<%= rtHours11_1.ClientID %>"]; radMaskedTextBox1.SetValue("00:00"); But I want to set the control name dynamically as this function will be called for many controls on the page. Can someone help me to modify it in the way that it will accept the control name dynamically as following: function InitilizeMe(thisCtrl) { var radMaskedTextBox1 = window["<%= thisCtrl.ClientID %>"];  radMaskedTextBox1.SetValue("00:00"); } Thanks in advance for your help.Regards.

how do i use javascript to change values of controls inside a gridview

i have 2 labels (lblRate,lblTotal) and a textbox (txtQuantity) in a itemtemplate of a gridview.I want to calculate the products of rate and quantity and show it in Total as the textbox loses focus...i cant use textchanged because i dont want the page to postback.How do i use javascript to achieve this??Please Help Urgently....<asp:TemplateField HeaderText="Rate">                <ItemTemplate>                    <asp:Label ID="lblRate" runat="server" Text='<%# Eval("Rate") %>' />                </ItemTemplate>            </asp:TemplateField> <asp:TemplateField HeaderText="Quantity">                <ItemTemplate>                    <asp:TextBox ID="txtQty" runat="server" />                </ItemTemplate>&

Change active tab in Ajax tab container using javascript

I have been using the ajax tab control. I need to change the active tab index of the tab container through javascript. Can please anyone tell me how can i do it Cheers Sohail Sayed

Trap Selected Index change event of listbox using Javascript.

Hi All, This is reagarding listbox selection. I have a list box with multi select option. I want to trap the selected index change event of Listbox through javascript. Item of list box can be selected using Click of mouse and also the keyboard up down key with shift. I tried onclick event to bind the javascript function. It works fine if I select by mouse, but it doesen't work for up/down key of keyboard. Thanks, Naveen

Silverlight media player change source and play from javascript

I am having trouble accessing an embedded Silverlight 2 media player in an aspx page from Javascript and was hoping someone might offer some insight on what's going on. What I want to do is fire a javascript event on the client when a button is pressed to change the Silverlight media player media source and then play the newly selected file. I found what seemed like a pretty straightforward example on the silverlight.net site that looked like this:<%@ Page Title="" Language="VB" MasterPageFile="~/master.master" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %> <%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %> <asp:Content ID="Content1" ContentPlaceHolderID="Middle" Runat="Server"> <asp:MediaPlayer ID="Media1" runat="server" Height="240px" Width="320px"> </asp:MediaPlayer> <button id="Button1" onclick="onPlay()" type="button">Play</button> <script type="text/javascript"> function onPlay() { try { var player = $find("ctl00_Middle_Media1"); player.set_mediasource("example.mp3");

How to change a value in the usercontrol through javascript

Hello,   I am trying to create a modalpopup user control using ModalPopup extender from the AjaxToolkit and a usercontrol, so that I could show a modal popup window on several pages, simply using the single user control. It will be shown whenevr a button is clicked and certain amount of work is done on the server side, say a "Save" button is clicked, the data is successfully saved in the database and then the modalpopu is shown. The website also has a master page. The title and the content has to be changed, depending upon which button on which page is clicked, or wheter the save was successful or not. I am having problem in changing them through code. I tried to use ScriptManager.RegisterClientScriptBlock to send the title and content values and try to execute a javascript on the master page, but the two controls on the user control come as null when I try to access them from js using the getElementById method. The following is the code:The usercontrol: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ModalPopup.ascx.cs" Inherits="Modal.Controls.ModalPopup" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <div> <asp:Button ID="Button1" style="display:none" runa

Can we change the "specify your own value" Text when you are using fill-in choice using javascript?


Can we change the "specify your own value" Text when you are using fill-in choice using javascript?

I need to change the text? If you guys know anything on this, let me know. 


Change selected row background color in gridview using javascript


hi frineds,

              i have a gridview with radio buttons in gridview i have chance to select only one item at a time in gridview like this

i need to change the row color of selected item in gridview with radio button using javascript if i select second row with radio button first row comes to normal condition now second row is in selected mode please help to write this functionality using javascript

How to change a label.text from Javascript?



I got a regular Javascript.

How to change a label.text from a javascript?

Thanks, Gil.

Text Change for Text Box not firing when changing the text from Javascript




I have a web page on which  I show a popup window on a button click which on closing updates text in a textbox on my webpage, I have text change event on this text box, this event is geting fired when I type something in text box and come out but its not firing when the text is change by my javascript function which is called by the popup window, anybody faced similar issues? please let me know how to handle this!!


thanks in advance



AD rename change doesnt syn with old profile in sharepoint


i  rename user last name in Active directory but home page Still displayes old user account

1) i found out that it creates new profile
2) when i make people search to add permissions it shows both old & new profile.

i also checked the timer profile syn timer job  job work properly & ran stsadm commands

like stsadm -o synce -deleteolddatabases

stsadm -o sync -synctiming m:5

stadm -0 sync sweeptiming m:1

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.

Bug: Does not change column type from nvarchar to ntext


Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend