C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






how to update data in selected div


Posted Date: 28 Aug 2008      Total Responses: 2

Posted By: Pradeep Kumar Chaudhary       Member Level: Gold     Points: 1


Dear friends,
Please suggest me how can i select a specified DIV by using checkbox from control tool to insert data into database.
For Example:
I have two DIVs (ID of div is respectively divCont,divImg).
In divCont we have to insert text, divImg for image.I don't have to update an image, only text have to update.At that time we need to select a specific div to update in database.
Regards,
Pradeep




Responses

Author: Raju.M    28 Aug 2008Member Level: GoldRating:     Points: 6
this is not actual code coz i have no vs2005 or other editing tool with me. this is a logic u can try or message me


use ajax.
<script lang='js' type='txt/js'>
function X()
{
if(document.getElementById("raju").checked==true)
{
var divCont=document.getElementById("myDIv").innerHTML;
AjaxRequest(divCont);
}

}

function AjaxRequest(insertvalue)
{
var Req;
try{Req=new XMLHttpRequest();}catch (e){try{Req=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){alert("Your browser does not support AJAX!");return false;}}}
Req.onreadystatechange=function()
{
if(Req.readyState==4)
{
var d=document.getElementById("myDiv");
if(d.innerHTML=="")
{d.innerHTML+=Req.responseText;}
else
{d.innerHTML="";d.innerHTML+=Req.responseText;}
}
}
Req.open("GET","InsertHandler.ashx?insertString="+insertvalue,true);
Req.send(null);
}

//************************
///in HanderFile
//**********************************
if(context.Request.Querystring["insertString"]!=null)
{
//u can call class file or .dll to insert
//after insert
context.response.write("Updated");

}



thank oyu
raju.m
http://www.makhaai.blogspot.com



Author: Palanivel    10 Oct 2008Member Level: SilverRating:     Points: 5
****Javascrip Code for Update Text *************

documet.getElementById(divCont).innerText = "<your text>"
documet.getElementById(divImg).innerText = "<your image text>"

but the draw back is whatever the text you written that will
display in browse. to avoid that you have to use the following
method

****Javascrip Code for Update HTML*************
var strPath ="<path of the image>";
documet.getElementById(divCont).innerHTML = "<your text>"
documet.getElementById(divImg).innerHTML = "<img src="+strPath+">"










Post Reply
You must Sign In to post a response.
Next : XML Driven - configurable Menu Control
Previous : Problem in Displaying Information from URL in HTML page
Return to Discussion Forum
Post New Message
Category: HTML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

conference call

Contact Us    Privacy Policy    Terms Of Use