|
|
Good Article. It works , Please tell me if iam wrong , we are not using .asmx file and WSDL . Instead of these two, we have referenced the C# class library.
Thanks in Advance
Regards,
Manowj
|
|
|
|
|
Hai all,
I have a multiline text box. I want to limit the charaters inside the textbox to 250. For that i written this code
in cs file i added the attributes like(txtEmpWithA is my textbox name)
this.txtEmpWithA.Attributes.Add("OnKeyPress", "txtreason_limit(event)");
and the function in aspx file
function txtreason_limit(evt)
{
if(document.form1.txtEmpWithA .value.length == 250)
{
evt.keyCode = 0;
return;
}
}
This is working fine when i am typing there ,but if i copy and paste,it taking more than 250 charactors
Please help
|
|
|
|
|
this can be handled by 2 ways
1) by writing the code for validating whether the text is greater than the length
if (TextBox1.Text.Length > 250)
{
Response.Write("The text is greater than 250");
}
(or)
2) disable copy and paste.
function DisableCopyPaste() //Prevents Copy, Paste, Select, ContextMenu in TextBox and MultiLine TextBox controls.
{
var myForm = document.forms[0];
for (var i = 0; i < myForm.elements.length; i++)
{
var elementType = myForm.elements[i].type;
if (elementType == 'text' || elementType == 'textarea')
{
document.getElementById(myForm.elements[i].id).onpaste = function(){return false;};
document.getElementById(myForm.elements[i].id).oncontextmenu = function(){return false;};
document.getElementById(myForm.elements[i].id).onselectstart = function(){return false;};
document.getElementById(myForm.elements[i].id).ondragstart = function(){return false;};
}
}
}
//paste this in page load
ClientScript.RegisterStartupScript(this.GetType(), "StartUpScript", @"DisableCopyPaste();");
Padmanabhan
|
|
|
|
|
It's a better way to use a custom validation control provided by the VS IDE.
Welcome to www.softwaretree.net!
This website is generated completely by static html pages transforming technology.
You can find many excellent audio/video tools there!
|
|
|
|
|
Hi all,
I am using a tab container,in that there are two tab panels.In one tab panel i have a gridview and in another some controls like textboxes.Problem is when i click on view button of gridview i want to display that particular record in the another tabpanel with the values in those controls.
can any one give me the solution for it.
Thanks in advance.
|
|
|
|
|
set the correct tabindex for the tabpages and the correct page is visible.
If you want 1 row of data out of your gridview you need select option add each gridviewrow of the gridview. The DataKeyName must also best so you know the selectedvalue (index value of your table in your database). With thatr value you can retrieve the neede values four your other tabpage
Where is your select button placed?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
hello
I've generated a keypair using sn.exe as follows:
STEP 1.generate snk file via "sn.exe -k" command:
sn.exe -k MyKeypairs.snk
STEP 2.install the keyset into a KeyContainer via "sn.exe -i" command:
sn.exe -i MyKeypairs.snk MY_RSA_Container
I understand that generally, they are used for assembly signing. I am asking if I can convert this (using makecert perhaps?) into a X509 test cert so I can install it on IIS?
Thanks
REF: http://www.devatwork.nl/index.php/2007/05/31/wcf-username-authentication/[^]
dev
|
|
|
|
|
Hello,
I use ASP .NET to publish office document on the web.
My problem is I want to modify Excel file through IE
(without downloading them).
I need to open the Excel sheet using IE and do all the functions available in Excel like grouping, merging cells and changing cell colors etc...
Has anybody got some tips for me ? Any suggestions would be appreciable?
CodingRocks
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Excel Services in the SharePoint 2007 can be used to use, share, calculate and edit Excel Workbooks online.
|
|
|
|
|
I am using Microsoft.Office.Interop.Owc11 for the excel editing.
But when I tried to open the file using the following code in Page Load event
public string SSxml;
protected void Page_Load(object sender, EventArgs e)
{
SpreadsheetClass spsh = new SpreadsheetClass();
string str = Server.MapPath(".") +"\\test.xls";
SSxml = spsh.XMLData;
}
I am getting an error saying "Exception from HRESULT: 0xE0040104"
How can I fix this issue.
I want to open the test.xls file as XMl Spreadsheet now.
CodingRocks
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Hi,
Iam run my Project in local system or online some characters are included in the address bar how to remove the this characters or how to solve this problem...eg:www.code.com/(S(v3b0chfior2fd03m2xv5ba55))/default.aspx
Thanks in advance...
|
|
|
|
|
In your web.config there might be a line:
<sessionState mode="InProc" cookieless="true" />
set cookieless to false and your problem is solved.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
hello
<br />
HtmlInputHidden txtEncryptedAuthToken = new HtmlInputHidden();<br />
txtEncryptedAuthToken.ID = "txtEncryptedAuthToken";<br />
FindControl("divAuthTokens").Controls.Add(txtEncryptedAuthToken);<br />
When rendered to client side, "Id" of this Html control becomes
<br />
ctl00_txtEncryptedAuthToken<br />
What I really want to do is to set "ClientId" from server side.
<br />
...<br />
txtEncryptedAuthToken.ClientID = "txtEncryptedAuthToken";<br />
...<br />
Unfortunately ClientId is read-only property - any suggestion than subclass HtmlInputHidden+override ClientId?
Thanks.
dev
|
|
|
|
|
I have a problem with the RegularExpressionValidator, i want to validate the Image extension of the FileUpload Control, it is working fine in my project, but after uploading the Project into server and checking from anywhere it is not working always showing the Error Message.
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ErrorMessage="Photo - Only .png,.bmp,.gif,.jpg files are allowed!"
ValidationExpression="^(([a-zA-Z] |(\\{2}\w+)\$?)(\\(\w[\w].*))+(.PNG|.png|.bmp|.BMP|.gif|.GIF|.jpg|.JPG|.jpeg|.JPEG)$"
ControlToValidate="cmdUpload" Display="None"></asp:RegularExpressionValidator>
|
|
|
|
|
Hi,
All i wanted to do is to update a user IsOnline or Offline.
If user Login, i can update in the database as TRUE. But if user session expires or browser closed, i do not know to update the database as FALSE.
Any of guys can help me out.
Thx.
|
|
|
|
|
I think you can use an AJAX request to the server, and if timesout, you can take the status as offline.
|
|
|
|
|
really? do u have any simple sample code on that part?
|
|
|
|
|
Hello,
We have an application that is developed in Java. This application internally uses contenta tool to save files such as doc, xls, pdf, etc etc. Using the application we save various files. The contenta tool's methods and classes are used to save the files internally in the oracle database and maintains history of the files too.
Now, we are planing to migrate the application into .NET and replace the contenta tool. Are there any tools that go well with .NET to save various files and maintain history of the files. Sharepoint is not our option.
PLease suggest
gauthee
|
|
|
|
|
|
Hi friends,
One of our customers has decided to migrate an existing Ruby on Rails application with MySQL DB backend to ASP.NET with C# (.NET 3.5) with SQL Server 2005/2008.
I have few questions about it.
1. Has anybody already done such migration?
2. Is there any recommended way to do this migration?
3. Are there any tools available helping in this type of migration?
Any comments/help would really be appreciated.
-----
Ajay Jadhav
http://www.divinet.co.in
|
|
|
|
|
ROR and ASP.NET are completely different technologies and do not share any common thing.
Therefore there seems to be no common tool in the market to migrate from ROR to ASP.NET.
You need to do it as a fresh development in asp.net and write the code from scratch.
|
|
|
|
|
Thank you Ramesh for the information. Your comments are really helpful for me to take further decisions.
-----
Ajay Jadhav
http://www.divinet.co.in
|
|
|
|
|
hi all
plz help me
how I can print an image in asp.net
thanks
regard
|
|
|
|
|
You know 'window.print()' function will print the HTML content of the current page in the browser window.
Put the image in a DIV tag and then use the following code. The content of the DIV is written to a new window and then printed in this code.,
<script type="text/javascript">
function ClientSidePrint(idDiv)
{
var w = 600;
var h = 400;
var l = (window.screen.availWidth - w)/2;
var t = (window.screen.availHeight - h)/2;
var sOption="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t;
var sDivText = window.document.getElementById(idDiv).innerHTML;
var objWindow = window.open("", "Print", sOption);
objWindow.document.write(sDivText);
objWindow.document.close();
objWindow.print();
objWindow.close();
}
</script>
modified on Monday, May 25, 2009 1:32 AM
|
|
|
|