This error ocuurs in server if you do not run the .msi installer on the server.
If you didn't, you need to copy the System.web.extension dll.
Wednesday, December 10, 2008
Solution to that extension conflict for system.Web.Extension
If in web.congig that extension conflicts ocuurs with dll of system.web.extension you can resolve it this stuff after system.web section completion.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Sunday, November 23, 2008
great links
Making Web Services Accessible from Script
http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx
Great Asp.net tutorial
http://www.beansoftware.com/ASP.NET%2DTutorials/
Different Date Format for sqlserver
http://www.sql-server-helper.com/tips/date-formats.aspx
Convert VB.NET to C# OR C# to VB.NET -
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
Job creation :-
http://www.databasedesign-resource.com/sql-server-jobs.html
Retriving and saving Image as binary:-
http://www.beansoftware.com/ASP.NET-Tutorials/Save-Read-Image-Database.aspx
Membership understanding :-
http://aspnet.4guysfromrolla.com/articles/101106-1.aspx
URL Rewriting:-
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
DotNetNuke Installation:-
http://www.bestwebsites.co.nz/dotnetnuke/easy-dotnetnuke-installation-guide/
UrlRewriting:-
http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-solution-for-asp.net-2.0/
http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx
Great Asp.net tutorial
http://www.beansoftware.com/ASP.NET%2DTutorials/
Different Date Format for sqlserver
http://www.sql-server-helper.com/tips/date-formats.aspx
Convert VB.NET to C# OR C# to VB.NET -
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
Job creation :-
http://www.databasedesign-resource.com/sql-server-jobs.html
Retriving and saving Image as binary:-
http://www.beansoftware.com/ASP.NET-Tutorials/Save-Read-Image-Database.aspx
Membership understanding :-
http://aspnet.4guysfromrolla.com/articles/101106-1.aspx
URL Rewriting:-
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
DotNetNuke Installation:-
http://www.bestwebsites.co.nz/dotnetnuke/easy-dotnetnuke-installation-guide/
UrlRewriting:-
http://www.simple-talk.com/dotnet/asp.net/a-complete-url-rewriting-solution-for-asp.net-2.0/
Sys is undefined error message
if (typeof(Sys) !== "undefined")
Sys.Application.notifyScriptLoaded();
Sys.Application.notifyScriptLoaded();
How to set up Membership using asp.net sql server registration tool
1) Member ship
aspnet_regsql -S [Server name] -U [username] -P [password] -A all -d [DataBaseName]
2) SQL Session State
aspnet_regsql -S [Server name] -U [username] -P [password] -ssadd -sstype c -d
3) DB Caching
aspnet_regsql.exe -S [Server name] -U [username] -P [password] -d -ed
aspnet_regsql -S [Server name] -U [username] -P [password] -A all -d [DataBaseName]
2) SQL Session State
aspnet_regsql -S [Server name] -U [username] -P [password] -ssadd -sstype c -d
3) DB Caching
aspnet_regsql.exe -S [Server name] -U [username] -P [password] -d -ed
Thursday, November 6, 2008
Download Pdf/excel/ or any file
String type = "Application/msword";
if (File.Exists(Server.MapPath("Certificatepdf.pdf")))
{
Response.AppendHeader("content-disposition", "attachment; filename=" + "Certificatepdf.pdf");
if (type != "")
Response.ContentType = type;
Response.WriteFile(Server.MapPath("Certificatepdf.pdf"));
Response.End();
}
if (File.Exists(Server.MapPath("Certificatepdf.pdf")))
{
Response.AppendHeader("content-disposition", "attachment; filename=" + "Certificatepdf.pdf");
if (type != "")
Response.ContentType = type;
Response.WriteFile(Server.MapPath("Certificatepdf.pdf"));
Response.End();
}
Monday, November 3, 2008
solution to fire click event through js in firefox not work
function fireClickEvent(control)
{
if (document.all)
{
control.fireEvent("onclick");
}
else
{
var clickEvent = window.document.createEvent("MouseEvent");
clickEvent.initEvent("click", false, true);
control.dispatchEvent(clickEvent);
}
}
{
if (document.all)
{
control.fireEvent("onclick");
}
else
{
var clickEvent = window.document.createEvent("MouseEvent");
clickEvent.initEvent("click", false, true);
control.dispatchEvent(clickEvent);
}
}
add new element in dropdown/listbox using javascript
function addOption(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function removeOption(selectbox,selectedIndex )
{
selectbox.remove(selectedIndex);
}
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function removeOption(selectbox,selectedIndex )
{
selectbox.remove(selectedIndex);
}
Solution to the InnerText Not work with Firefox
function getText(el)
{
if ('string' == typeof el.textContent) return el.textContent;
if ('string' == typeof el.innerText) return el.innerText;
return el.innerHTML.replace(/<[^>]*>/g,'');
}
function setText(el,str)
{
if ('string' == typeof el.textContent)
el.textContent = str;
if ('string' == typeof el.innerText)
el.innerText = str;
}
{
if ('string' == typeof el.textContent) return el.textContent;
if ('string' == typeof el.innerText) return el.innerText;
return el.innerHTML.replace(/<[^>]*>/g,'');
}
function setText(el,str)
{
if ('string' == typeof el.textContent)
el.textContent = str;
if ('string' == typeof el.innerText)
el.innerText = str;
}
Tuesday, October 7, 2008
Create & remove & edit inline divs dynamically
OutPut:-
CSS :-
body {margin:0; font-family:Arial, Helvetica, sans-serif; font-size:12px}
#slider {width:459px}
.header {width:439px; border:2px solid #9ac1c9; padding:8px; font-weight:bold; margin-top:5px; cursor:pointer; background:url(images/header.gif)}
.header:hover {background:url(images/header_over.gif)}
.content {overflow:hidden}
.text {width:425px; border:2px solid #9ac1c9; border-top:none; padding:15px}
Javascript:-
<script type="text/javascript">
var flg_glob=1;
function creatediv()
{
var lblLeft = document.getElementById('<%= lblLeftPane.ClientID %>');
lblLeft.innerHTML += "<div class='header' id='header" + flg_glob + "' onclick='replacetxt("+ flg_glob + ")'><div style='display:inline;width:100%'><div style='width:30%;float:left;'><input type='text' id='txt" + flg_glob +"' style='display:none' onblur='change(" + flg_glob + ")'/><label id='lbl" + flg_glob + "' style='display:block;'>Header One</label></div><div style='width:60%;float:left;text-align:right'><input type='button' value='close' onclick='onClose(" + flg_glob +")'/></div></div></div>";
flg_glob = flg_glob +1;
return false;
}
function replacetxt(txt1)
{
document.getElementById('txt' + txt1).style.display = "block";
document.getElementById('txt' + txt1).value = document.getElementById('lbl' + txt1).innerText
document.getElementById('lbl' + txt1).style.display = "none";
document.getElementById('txt' + txt1).focus();
}
function change(txt1)
{
var val = document.getElementById('txt' + txt1).value;
document.getElementById('txt' + txt1).style.display = "none";
document.getElementById('lbl' + txt1).style.display = "block";
document.getElementById('lbl' + txt1).innerText = val;
}
function onClose(txt1)
{
var el1 = document.getElementById('slider');
var el = document.getElementById('header' + txt1);
el.parentNode.removeChild(el);
// el.removeChild(el);
}
</script>
Aspx Page:-
<asp:Button ID="btn" runat="server" OnClientClick="return creatediv()" Text="Add"/>
<div id="slider">
<asp:Label ID="lblLeftPane" runat="server"></asp:Label>
</div>
CSS :-
body {margin:0; font-family:Arial, Helvetica, sans-serif; font-size:12px}
#slider {width:459px}
.header {width:439px; border:2px solid #9ac1c9; padding:8px; font-weight:bold; margin-top:5px; cursor:pointer; background:url(images/header.gif)}
.header:hover {background:url(images/header_over.gif)}
.content {overflow:hidden}
.text {width:425px; border:2px solid #9ac1c9; border-top:none; padding:15px}
Javascript:-
<script type="text/javascript">
var flg_glob=1;
function creatediv()
{
var lblLeft = document.getElementById('<%= lblLeftPane.ClientID %>');
lblLeft.innerHTML += "<div class='header' id='header" + flg_glob + "' onclick='replacetxt("+ flg_glob + ")'><div style='display:inline;width:100%'><div style='width:30%;float:left;'><input type='text' id='txt" + flg_glob +"' style='display:none' onblur='change(" + flg_glob + ")'/><label id='lbl" + flg_glob + "' style='display:block;'>Header One</label></div><div style='width:60%;float:left;text-align:right'><input type='button' value='close' onclick='onClose(" + flg_glob +")'/></div></div></div>";
flg_glob = flg_glob +1;
return false;
}
function replacetxt(txt1)
{
document.getElementById('txt' + txt1).style.display = "block";
document.getElementById('txt' + txt1).value = document.getElementById('lbl' + txt1).innerText
document.getElementById('lbl' + txt1).style.display = "none";
document.getElementById('txt' + txt1).focus();
}
function change(txt1)
{
var val = document.getElementById('txt' + txt1).value;
document.getElementById('txt' + txt1).style.display = "none";
document.getElementById('lbl' + txt1).style.display = "block";
document.getElementById('lbl' + txt1).innerText = val;
}
function onClose(txt1)
{
var el1 = document.getElementById('slider');
var el = document.getElementById('header' + txt1);
el.parentNode.removeChild(el);
// el.removeChild(el);
}
</script>
Aspx Page:-
<asp:Button ID="btn" runat="server" OnClientClick="return creatediv()" Text="Add"/>
<div id="slider">
<asp:Label ID="lblLeftPane" runat="server"></asp:Label>
</div>
Monday, October 6, 2008
Asp.Net
This is javascript for Mouse hover image expansion
<script>
// Thumbnail expansion and reduction animation//use expandthumb(
exid = 0;exstep = 0;exwdth = 0;exht = 0;extp = 0;exlft = 0;extot = 0;extotst = 15;
function expandthumb(thumbid, fullwidth, fullheight)
{
if (extot != 0) {
clearTimeout(extot);
}
if (exid > 0 && exid != thumbid) {
restorethumb(); }
if (exid != thumbid) {
img = document.getElementById("screen" + thumbid);
img.style.display = 'block'; exid = thumbid;
exstep = 1;
exwdth = fullwidth;
exht = fullheight;
extp = img.offsetTop;
exlft = img.offsetLeft; }
else if (exstep < 1) { exstep = 1; } expandstep();}
function doexpand() {
img = document.getElementById("screen" + exid);
thumb = document.getElementById("thumb" + exid);
myscroll = getScroll();
if (extp + thumb.height > myscroll.top + myscroll.height) {
finaltop = myscroll.top + myscroll.height - exht; } else { finaltop = extp + thumb.height - exht; }
if (finaltop < myscroll.top) { finaltop = myscroll.top; }
img.style.top = finaltop + ((extp - finaltop) * (extotst - exstep) / extotst) + 'px';
if (exlft + thumb.width > myscroll.left + myscroll.width) {
finalleft = myscroll.left + myscroll.width - exwdth; }
else { finalleft = exlft + thumb.width - exwdth; }
if (finalleft < myscroll.left) { finalleft = myscroll.left; } img.style.left = finalleft + ((exlft - finalleft) * (extotst - exstep) / extotst) + 'px';
img.width = thumb.width + ((exwdth - thumb.width) * exstep / extotst); img.height = thumb.height + ((exht - thumb.height) * exstep / extotst);}
function restorethumb() {
img = document.getElementById("screen" + exid);
img.style.top = ''; img.style.left = '';
img.style.display = 'none'; exid = 0;}
function expandstep() {
extot = 0; doexpand();
if (exstep < extotst) {
exstep++; extot = setTimeout("expandstep()", 20); }}
function reducestep() {
extot = 0; doexpand();
if (exstep > 0) {
exstep--; extot = setTimeout("reducestep()", 20); }
else { restorethumb(); }}
// returns the scroll position and size of the browser
function getScroll() {
if (document.all && typeof document.body.scrollTop != "undefined") {
// IE model
var ieBox = document.compatMode != "CSS1Compat";
var cont = ieBox ? document.body : document.documentElement;
return {
left: cont.scrollLeft, top: cont.scrollTop, width: cont.clientWidth, height: cont.clientHeight }; }
else { return { left: window.pageXOffset, top: window.pageYOffset, width: window.innerWidth, height: window.innerHeight }; }}
<script>
<img src='12.jpg' width="400" height="400" alt='img' border="2" id='screen112' onmouseout='reducethumb(112); return false;' style='position: absolute; display: none;'>
<img src='12.jpg' width="100" height="100" alt='mis' border="2" id='thumb112' onmouseover='expandthumb(112, 500, 449);'>
<script>
// Thumbnail expansion and reduction animation//use expandthumb(
exid = 0;exstep = 0;exwdth = 0;exht = 0;extp = 0;exlft = 0;extot = 0;extotst = 15;
function expandthumb(thumbid, fullwidth, fullheight)
{
if (extot != 0) {
clearTimeout(extot);
}
if (exid > 0 && exid != thumbid) {
restorethumb(); }
if (exid != thumbid) {
img = document.getElementById("screen" + thumbid);
img.style.display = 'block'; exid = thumbid;
exstep = 1;
exwdth = fullwidth;
exht = fullheight;
extp = img.offsetTop;
exlft = img.offsetLeft; }
else if (exstep < 1) { exstep = 1; } expandstep();}
function doexpand() {
img = document.getElementById("screen" + exid);
thumb = document.getElementById("thumb" + exid);
myscroll = getScroll();
if (extp + thumb.height > myscroll.top + myscroll.height) {
finaltop = myscroll.top + myscroll.height - exht; } else { finaltop = extp + thumb.height - exht; }
if (finaltop < myscroll.top) { finaltop = myscroll.top; }
img.style.top = finaltop + ((extp - finaltop) * (extotst - exstep) / extotst) + 'px';
if (exlft + thumb.width > myscroll.left + myscroll.width) {
finalleft = myscroll.left + myscroll.width - exwdth; }
else { finalleft = exlft + thumb.width - exwdth; }
if (finalleft < myscroll.left) { finalleft = myscroll.left; } img.style.left = finalleft + ((exlft - finalleft) * (extotst - exstep) / extotst) + 'px';
img.width = thumb.width + ((exwdth - thumb.width) * exstep / extotst); img.height = thumb.height + ((exht - thumb.height) * exstep / extotst);}
function restorethumb() {
img = document.getElementById("screen" + exid);
img.style.top = ''; img.style.left = '';
img.style.display = 'none'; exid = 0;}
function expandstep() {
extot = 0; doexpand();
if (exstep < extotst) {
exstep++; extot = setTimeout("expandstep()", 20); }}
function reducestep() {
extot = 0; doexpand();
if (exstep > 0) {
exstep--; extot = setTimeout("reducestep()", 20); }
else { restorethumb(); }}
// returns the scroll position and size of the browser
function getScroll() {
if (document.all && typeof document.body.scrollTop != "undefined") {
// IE model
var ieBox = document.compatMode != "CSS1Compat";
var cont = ieBox ? document.body : document.documentElement;
return {
left: cont.scrollLeft, top: cont.scrollTop, width: cont.clientWidth, height: cont.clientHeight }; }
else { return { left: window.pageXOffset, top: window.pageYOffset, width: window.innerWidth, height: window.innerHeight }; }}
<script>
<img src='12.jpg' width="400" height="400" alt='img' border="2" id='screen112' onmouseout='reducethumb(112); return false;' style='position: absolute; display: none;'>
<img src='12.jpg' width="100" height="100" alt='mis' border="2" id='thumb112' onmouseover='expandthumb(112, 500, 449);'>
Subscribe to:
Posts (Atom)