|
Hi everyone.
When create a webcontrol inherit from Panel,I want to add some Control in it and that control must display when Develop user my Panel , it same as Login Control in ASP.Net library.
Please help me.
Thanks and best regards.
|
|
|
|
|
Use the render method, add the controls you need to display to the panel. It will be shown next time when you use the custom control.
|
|
|
|
|
Thanks <N a va n e e t h>
I have known render method, but it just show up Htmp element , i can't get value of that html element in my webcontrol when i want to do something.
I want to add dynamic Asp control in my webcontrol, because GUI of my webcontrol depend on database.
Ex: Dynamic Add two TextBox and a Button in Page_Load of my WebControl and add Click event for this button, I will get Text of two those TextBox when this button click.
Thus as, How to show up all dynamic control when I use my WebControl in another page
Best regards.
|
|
|
|
|
Hello all
In my application i am creating a document based on user responses. Now i want to save the document as soon as it create in a folder. How can i do this?(Actually i want to send the file to user as attachment with the mail as soon as it create)
Please tell me...
Thanks.
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Hello Friends,
I'm working on a project. But whenever i'm trying to save some text as given below.
Hello This is India........
it's saving text in SQL Server 2000 from ASP.NET. But whenever i'm trying to save the text as given below then it's throwing an error as given below.
I'm an Indian
Incorrect syntax near 'm'. Unclosed quotation mark before the character string '
|
|
|
|
|
hello,
In your there is no any 'm', then why come this type of error?
U must missing something else.
for inserting a string u must quoted the string but for number must not quoted the number.
for example : (sname is varchar2, Roll is number)
String strQuery = "insert into table1 (sname, Roll) values ('" + txtName.text + "'," + txtRoll.text + ")";
I think u r missing any quotation. (single quote ')
ok
Best of luck..
Dipak
|
|
|
|
|
Sorry Friend i forgot to explain the line through which error was being thrown
I'm........
Because of this sentence error is being generated
|
|
|
|
|
I guess you are concatenating the string for your query formation. Don't do that, it's open to SQL Injection. Use parameterized queries which won't throw these kind of exceptions.
|
|
|
|
|
Navaneeth i explain my probs. again.
I've a TextBox in which i enters Name like Jame's and then i click on submit button. But it throws error Incorrect syntax near 's'. Unclosed quotation mark before the character string '
Plz ......
|
|
|
|
|
Quick solution for this issue is by replacing the single qoute with 2 single quotes.
Permanent solution is SQL Injection.
|
|
|
|
|
Before inserting convert the string if it contain single quote (') to double quote (''). It will work. i also had faced this type of problem.
After inserting it stores in the database with single quote.
try it.
and reply..
Best of Luck.
Dipak
|
|
|
|
|
Yes I understand. Problem is in your query forming, You will be forming the query like this now
string query = "Insert into mytable values('" + TextBox1.Text + "')"; Problem here is when a single quotation (') is coming to the text box, your query will become invalid and it throws the exception. Forming queries like this is a bad practice. You need to use parameters to avoid this problem. Look at the example below.
SQLCommand command = new SQLCommand("Insert into mytable values(@FirstValue)",connection);
command.Parameters.Add("@FirstValue",TextBox1.Text); The above method is safe from SQL injection attacks. Don't use easy methods like replacing single quotes to double as a solution.
|
|
|
|
|
Hi All
I am geting problem whilw i using StateServer mode of session state in webconfig.
if I write like this , then its running well...
<sessionstate mode="StateServer" stateconnectionstring="tcpip=127.0.0.1:42424">
stateNetworkTimeout="20" timeout="20" cookieless="false" />
but if I use my system's IP instead of 127.0.0.1 then application is not running.
error comes like this....
"Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name."
I already started ASPStateServer Service.
please help me
thanks
|
|
|
|
|
hey all
i found solution for this..
first sallow remote connetion from registery
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection
set value to 1
then restart ASP.NetStateService ..
it will work now...
|
|
|
|
|
Again, I ask the question because after hours of searching on google and reading through my brand new asp.net books, I have not found any reference to setting up internal email so that members for an asp.net website can message each other WITHIN the website. I am not talking about simply emailing someone to an external email account like google, hotmail, etc.
Does anyone know of any text or specific "tech" word that would reference that?
I have alot of reading to do, but I just don't see anyone online that can send me in the right direction.
Oh and by the way I did find some good articles on passing data through from one page to another so it can be stored in a database. I'll make a more SPECIFIC post when I get the error message.
Thanks guys.
|
|
|
|
|
|
I am using Ajex in asp.net with C#. when I drag and drop the update panel my frmDefault.aspx then remove the intelligence help in source file frmDefault.aspx.
|
|
|
|
|
Gagan Deep Garg wrote: I am using Ajex in asp.net with C#. when I drag and drop the update panel my frmDefault.aspx then remove the intelligence help in source file frmDefault.aspx.
OK... I understood...
|
|
|
|
|
I would first suggest you to frame a complete sentence properly and express youself with clarity without any ambiguities. If you are seriously distraught and struck in a language barrier, since you are India, check out http://www.veta.in/[^].
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi all
How to DownLoad a file of any format(like .pdf, .doc etc.) which is stored in database in byte format
thanks in advance...
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Simple. Get the bytes from the database, and save it as a file with proper file extension.
|
|
|
|
|
but how do i....?
i dont know the file format...
thanx for the reply..
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Thanks a lot...
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Software Development
How to Download any file from ASP.NET
You know, some formats (txt, gif etc.) will be shown on the browser rather than downloading when we try. Below is the script which will help you to download any file.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
Response.Clear();
Response.AddHeader(“Content-disposition”, “attachment; filename=”);
Response.WriteFile(“C:\”);
Response.End();
modified on Thursday, February 21, 2008 1:27 PM
|
|
|
|
|
how to show the panel scroll bar when it is loded for the first time
|
|
|
|