Click here to Skip to main content
15,890,512 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to position div just over the textbox? Pin
Brij13-Nov-10 23:52
mentorBrij13-Nov-10 23:52 
QuestionHow to pass data to gridview(Long Post) Pin
future383913-Nov-10 13:46
future383913-Nov-10 13:46 
AnswerRe: How to pass data to gridview(Long Post) Pin
thatraja15-Nov-10 1:47
professionalthatraja15-Nov-10 1:47 
QuestionWhat is best way to show Grid inside a TabPanel Pin
Steve van Niman13-Nov-10 11:26
Steve van Niman13-Nov-10 11:26 
QuestionHost Web Service and Web Site in virtual directory & app pool Pin
kakarato13-Nov-10 5:06
kakarato13-Nov-10 5:06 
AnswerRe: Host Web Service and Web Site in virtual directory & app pool Pin
Brij13-Nov-10 7:14
mentorBrij13-Nov-10 7:14 
Questionmultiple getJSON issue [modified] Pin
musefan12-Nov-10 5:28
musefan12-Nov-10 5:28 
QuestionFail to avoid postback for button click Pin
Tridip Bhattacharjee11-Nov-10 23:01
professionalTridip Bhattacharjee11-Nov-10 23:01 
i found a serious problem that when i click on button then postback happen but i stopped the postback.

my code is follows. please see what is wrong in it.
-----------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript">
    
    function ShowDiv()
	{	
	    var modalWindow = document.createElement('div');
	    modalWindow.style.position = 'absolute';
	    modalWindow.style.height = '100px';
	    modalWindow.style.width  = '100px';
	    modalWindow.style.left = (modalWindow.style.height - getDocHeight())/2;
	    modalWindow.style.top  = (modalWindow.style.width - getDocWidth())/2;
	    modalWindow.style.backgroundColor = '#C0C0C0';
	    modalWindow.innerHTML = 'hello...';
	    document.body.appendChild(modalWindow);
	    return false;
	}	


	function getDocHeight() 
	{
		return Math.max(document.getElementById('TextBox1').style.height );
	}			

	function getDocWidth() 
	{
	    return Math.max(document.getElementById('TextBox1').style.width );
	}	    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<asp:Button ID="Button1" runat="server" Style="left: 745px; position: relative;
            top: 298px" Text="Button" OnClientClick=" return ShowDiv()"  />
        <asp:TextBox ID="TextBox1" runat="server" Height="180px" Style="left: 307px; position: relative;
            top: 264px" TextMode="MultiLine" Width="432px"></asp:TextBox></div>
    </form>
</body>
</html>


here ShowDiv() function return false. another thing i notice that when i comment all the line in function ShowDiv() then postback is not happening. i just do not understand if i generate a div and add to page from javascript then why postback happening.

please tell me the solution to avoid postback when i will generate div from any function. if possible please rectify my code.

thanks
tbhattacharjee

AnswerRe: Fail to avoid postback for button click Pin
Brij12-Nov-10 1:12
mentorBrij12-Nov-10 1:12 
GeneralRe: Fail to avoid postback for button click Pin
Tridip Bhattacharjee12-Nov-10 2:00
professionalTridip Bhattacharjee12-Nov-10 2:00 
GeneralRe: Fail to avoid postback for button click Pin
Brij12-Nov-10 6:38
mentorBrij12-Nov-10 6:38 
QuestionShowing content pages without MasterPage in DesignView. Pin
Asif Rehman11-Nov-10 4:03
Asif Rehman11-Nov-10 4:03 
AnswerRe: Showing content pages without MasterPage in DesignView. Pin
Brij11-Nov-10 6:32
mentorBrij11-Nov-10 6:32 
AnswerRe: Showing content pages without MasterPage in DesignView. Pin
Vimalsoft(Pty) Ltd14-Nov-10 20:03
professionalVimalsoft(Pty) Ltd14-Nov-10 20:03 
QuestionDetailsView FormView - SelectedValue bug Pin
Hanzaplast11-Nov-10 3:10
Hanzaplast11-Nov-10 3:10 
QuestionNavigating from a page to Wizrd page Pin
meeram39511-Nov-10 2:47
meeram39511-Nov-10 2:47 
AnswerRe: Navigating from a page to Wizrd page Pin
Not Active11-Nov-10 3:10
mentorNot Active11-Nov-10 3:10 
GeneralRe: Navigating from a page to Wizrd page Pin
meeram39511-Nov-10 12:30
meeram39511-Nov-10 12:30 
GeneralRe: Navigating from a page to Wizrd page Pin
Not Active11-Nov-10 12:46
mentorNot Active11-Nov-10 12:46 
QuestionAspDotNetStorefront Pin
Civic0611-Nov-10 2:33
Civic0611-Nov-10 2:33 
Questionhow to show busy indicator in the center of multiline textbox control Pin
Tridip Bhattacharjee11-Nov-10 1:51
professionalTridip Bhattacharjee11-Nov-10 1:51 
AnswerRe: how to show busy indicator in the center of multiline textbox control Pin
Not Active11-Nov-10 2:31
mentorNot Active11-Nov-10 2:31 
GeneralRe: how to show busy indicator in the center of multiline textbox control Pin
Tridip Bhattacharjee11-Nov-10 19:09
professionalTridip Bhattacharjee11-Nov-10 19:09 
GeneralRe: how to show busy indicator in the center of multiline textbox control Pin
Rhys Gravell11-Nov-10 21:33
professionalRhys Gravell11-Nov-10 21:33 
QuestionXmlSerializer(typeof()) : There was an error reflecting type exception. [modified] Pin
swjam11-Nov-10 1:00
swjam11-Nov-10 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.