|
Hi dear all,
i am using the ajax enable web site. i created a master page where i placed Script manager and Update Panel. and a contenat place holder into the Update Panel. the master page have some buttons which is used to display other page(content page).
but when i run this web site and when i click any button it reloads whole page again.it there any setting for this into web.config file or properties of update panel that i have to make.
|
|
|
|
|
I would suggest you download the ASP.NET AJAX samples, run them and then work out why they work and your code does not. Or, read the documentation. If you still can't work it out, post the code here, so people can help you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is the button inside the updatepanel ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
EnablePartialRendering="true"
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
Hi All,
I am facing a proble in ASP.Net 1.0.
The Prob is that I am generating TextBoxes on user input. Like if user input 3 in textbox and click generate button 3 textboxes are added to Table Control (Web Control).
But when I m trying to access its .Text in code behind it is not showing anything..
My code sample is here
''Generate button
For i = 1 To num
Dim r As New TableRow()
Dim c As New TableCell()
Dim txtCaf As New TextBox()
txtCaf.ID = "txtCAF" & i.ToString
txtCaf.Attributes.Add("onkeypress", ONLY_NUMBER)
txtCaf.MaxLength = 10
Dim txtNoOfMDN As New TextBox()
txtNoOfMDN.ID = "txtNoOfMDN" & i.ToString
txtNoOfMDN.Attributes.Add("onkeypress", ONLY_NUMBER)
txtNoOfMDN.MaxLength = 3
c.Controls.Add(New LiteralControl(i))
r.Cells.Add(c)
c = New TableCell()
c.Controls.Add(txtCaf)
r.Cells.Add(c)
c = New TableCell()
c.Controls.Add(txtNoOfMDN)
r.Cells.Add(c)
Table1.Rows.Add(r)
Next
Access its value..
txtCaf = CType(Page.FindControl("txtCaf" & i.ToString), TextBox)
'this show Nothing
Please Help...
Be an Eagle, Sky is Yours.
|
|
|
|
|
Please read the forum guidelines, Please Help is a useless subject line.
Where do you add these controls ? If you add them during page load or later, they will not have any viewstate. they should still exist, assuming you added them before this code. If the access code is in an event, and the code to add is in page prerender, the controls are not there yet. But, I do expect once you find the control, you'll find it has no value.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sir,
Thanks for your reply..
Controls are added on Button's click event (after page load).
But I want to access its value..
Can you suggest me any idea to do this...
Be an Eagle, Sky is Yours.
|
|
|
|
|
suresh suthar wrote: Controls are added on Button's click event (after page load).
That's the problem. Read about ASP.NET page life cycle and how it uses viewstate to manage the control values. ASP.NET won't maintain viewstate for controls that are created on page_load .
|
|
|
|
|
Like Navaneeth said. The buttons you added on one click, will disappear in the next one. Your best bet is to abandon ASP.NET 1.0, although the problem persists in up to date versions of the framework, there are more appropriate events you can hook into. Any tutorial you find online may well tell you to hook into events you don't even have.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
My Sqlserver in on a local windows 2003server which is connected in Lan and
internet connection is through
Router
And i have to access its Database through internet or Remote connection.
Suppose my internet provider ip address is 192.178.12.101 and
My local windows server 2003 lan ip address is 192.148.1.86
So what will be my connection string
Thanking You
email add: manish.m.meshram@gmail.com
|
|
|
|
|
you need to expose your database to the internet. Then it's the IP address of your machine on the internet. The local address is worthless.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello
I do not find any article in your blog about
"connection to local sqlserver through internet"
Take an example
In textbox i am giving "tcp:192.168.1.81,1433"
string conn = "Data Source=" + @textbox.Text + @"\CCSSQLSERVER2005;Initial Catalog=CCSHMSDNET;Integrated Security=True";
My local machine is in network, i have to access it through
Router by internet
email add: manish.m.meshram@gmail.com
|
|
|
|
|
OK, I finally have a client that wants me to deploy a web app (all my previous clients have only wanted the files, and they would take the responsibility of loading them onto the server.) Anyway, I have never done this before, and I seem to be having some difficulties. It could be a problem with the hoster (Earthlink), but I want to make sure that I'm doing everything correctly before I start complaining to the hoster.
I am first uploading a super simple, almost Hello World app. As I understand it, the only files I really need are:
Default.aspx (or whatever the page is named)
Web.config
the code behind DLL
When I do a deployment from Visual Studio, the first 2 files are in the top directory, and there is the /bin subdirectory with the DLL, and also a Program Debug Database (that I obviously I would not want to have, unless I were debugging the app.) Anyway, I used the Deployment menu item and FTP'd it to the server with no problem; the files were in the same relative subdirectory system on the server.
I try to go to the URL of the Default.aspx, and I get the message:
The requested URL /default.aspx was not found on this server.
I would think that if there was some problem with the DLL being in the wrong directory (e.g., maybe it should go in the top level dir?), that at least the ASPX file would load up, just with nothing happening, or some ugly message, if I did anything. I am not even getting that, so I think it is a problem with the hoster.
So anyway, I'd like to know if I have at least done everything on my end correctly. Thanx
|
|
|
|
|
Is IIS set up to run ASP.NET ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I don't know if the hoster has this properly setup. Are you saying that if this were not set up, that this type of error could happen?
|
|
|
|
|
Yes, if the host is not set up for ASP.NET, you will get an error.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
We want to manually publish a asp.net website, We have read that .net framework 2.0 does not need any precompilation of the code to publish as a website , So we tried to publish a simple application in IIS 6.0 as a new website, we gave the right path of the file , set all the properties and the permission, but when we browse the website in IIS console itself it displays as "The Page cannot be displayed ". Can someone help us in getting the right way to create a website with the non compiled aspx code.
Regards,
Nancy
|
|
|
|
|
Is IIS set up to run a .NET 2.0 website ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for your help. We missed to set the IIS for Asp.net 2.0
|
|
|
|
|
How to encrypt and decrypt text in asp.net? I can able to encrypt text from textbox but i don't how to decrypt it.
|
|
|
|
|
Well, if you encrypted it, you should know how to decrypt it, you reverse the same method. Hashes like MD5 are not encryption, and cannot be reversed. Look at the Cryptography namespace to see what your options are.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is there any method to encrypt & decrypt text?
|
|
|
|
|
There are many. They are all in that namespace I told you to look into.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I tried below code for encryption
MemoryStream ms = new MemoryStream();
Rijndael alg = Rijndael.Create();
System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] input = enc.GetBytes(TextBox1.Text.ToString());
CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write);
cs.Write(input, 0, input.Length);
cs.Close();
byte[] encrypt = ms.ToArray();
TextBox2.Text = enc.GetString(encrypt);
its work fine.
to decrypt this i used the below code
MemoryStream ms = new MemoryStream();
Rijndael alg = Rijndael.Create();
System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] input = enc.GetBytes(TextBox2.Text.ToString());
CryptoStream cs = new CryptoStream(ms, alg.CreateDecryptor(), CryptoStreamMode.Write);
cs.Write(input, 0, input.Length);
cs.Close();
byte[] decrypt = ms.ToArray();
TextBox3.Text = enc.GetString(decrypt);
but this throws exception as
Padding is invalid and cannot be removed.
how can i come out of this problem?
|
|
|
|
|
Use this class...
public class Rijndael
{
public static string Encrypt(string text, string key)
{
RijndaelManaged rijndael = new RijndaelManaged();
byte[] plainText = System.Text.Encoding.Unicode.GetBytes(text);
byte[] salt = Encoding.ASCII.GetBytes(key.Length.ToString());
PasswordDeriveBytes secretKey = new PasswordDeriveBytes(key, salt);
ICryptoTransform Encryptor = rijndael.CreateEncryptor(secretKey.GetBytes(32), secretKey.GetBytes(16));
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, Encryptor, CryptoStreamMode.Write);
cryptoStream.Write(plainText, 0, plainText.Length);
cryptoStream.FlushFinalBlock();
byte[] cipherBytes = memoryStream.ToArray();
memoryStream.Close();
cryptoStream.Close();
return Convert.ToBase64String(cipherBytes);
}
public static string Decrypt(string text, string key)
{
RijndaelManaged rijndael = new RijndaelManaged();
byte[] encryptedText = Convert.FromBase64String(text);
byte[] salt = Encoding.ASCII.GetBytes(key.Length.ToString());
PasswordDeriveBytes secretKey = new PasswordDeriveBytes(key, salt);
ICryptoTransform Decryptor = rijndael.CreateDecryptor(secretKey.GetBytes(32), secretKey.GetBytes(16));
MemoryStream memoryStream = new MemoryStream(encryptedText);
CryptoStream cryptoStream = new CryptoStream(memoryStream, Decryptor, CryptoStreamMode.Read);
byte[] plainText = new byte[encryptedText.Length];
int DecryptedCount = cryptoStream.Read(plainText, 0, plainText.Length);
memoryStream.Close();
cryptoStream.Close();
return Encoding.Unicode.GetString(plainText, 0, DecryptedCount);
}
}
e.g.
TextBox2.Text = Rijndael.Encrypt(TextBox1.Text, "SecurityKey");
TextBox3.Text = Rijndael.Decrypt(TextBox2.Text, "SecurityKey");
modified on Wednesday, August 26, 2009 10:46 AM
|
|
|
|