Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnClientClick And OnClick

Status
Not open for further replies.

jyosh

IS-IT--Management
Jun 5, 2007
1
US
I have a link button and a button on the same page



When I click the link button I have to redirect it to a different page. When I click the button I have to open a new window..



For the button I am using OnClientClick

For the linkButton I am using on Click



Here is the code for both of them



<script type="text/javascript">

function ShowCostForm(contractCostId)

{

window.radopen('ContractCostEdit.aspx?ContractId=<%# oContract.ContractId %>&ContractCostId=' + contractCostId, 'CostEditWindow');

return false;

}

</script>



<asp:Button ID="btnAddCost" runat="server" Text="Add Cost" OnClientClick="return ShowCostForm();"/>





For the Button



<asp:LinkButton ID="VName" runat="server" OnClick="VName_Click">VendorName</asp:LinkButton></td>



When I click on the linkbutton it goes to ShowCostForm Method. I guess its because of OnClientClick of the button control. I am trying to use only OnClick in the button and it shows an error.

Is there a way to do this?
 
>>When I click on the linkbutton it goes to ShowCostForm Method

can you do a view sourc of the page and give us the HTML outputted both by the link button and the button???

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top