|
I have a wizrd control in my form. In one of the steps, there is one file upload control where the user needs to upload only PDF files. I have a validation for that and it works correctly.
The issue is, whenever the user uploads a word document or txt document, the validation message appears and then the user clicks on Next button instead of upload button, the textbox near the browse button clears automatically.
Is this the intended behaviour of upload control? Is it possible to retain the value entered in the textbox of fileupload control? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
modified on Thursday, July 16, 2009 2:05 AM
|
|
|
|
|
Hai all,
I'm encrypting the password by using the code as below . Please tell me how to decrypt the same.Please help me..
#region Password Util
public static string HashPassword(string plainMessage)
{
byte[] data = Encoding.UTF8.GetBytes(plainMessage);
using (HashAlgorithm sha = new SHA256Managed())
{
byte[] encryptedBytes = sha.TransformFinalBlock(data, 0, data.Length);
return Convert.ToBase64String(sha.Hash);
}
}
#endregion
protected void btnSubmit_Click(object sender, EventArgs e)
{
bo.UserID = txtUserId.Text;
Password p = new Password(txtPassword.Text.ToString());
String newpwd = p.SaltedPassword;
System.Nullable<int> newsaltkey = p.Salt;
bo.Encryptpwd = newpwd;
bo.Saltkey = p.Salt;
bo.Password = txtPassword.Text;
passwordFormat = MembershipPasswordFormat.Hashed;
if (passwordFormat == MembershipPasswordFormat.Hashed)
bo.Blogpwd = HashPassword(txtPassword.Text);
else
bo.Blogpwd = txtPassword.Text;
|
|
|
|
|
Hash Algorithm are one way encryption.You can not decrypt what you can do,you can encrypt the text and then match with the encrypted one.If you require to decrypt the data then you can use other algorithms...
|
|
|
|
|
But i'm not getting the input password from user.ok let me look at some other option.
|
|
|
|
|
Hi,
You have asked this question so many times............
Answer is same HASH IS ONE WAY ENCRYPTION
himanshu
|
|
|
|
|
I havn't ask some many times.This is second time.First time i didnt get the expected answer.Thats y i post the same message again.Got it..
|
|
|
|
|
|
Thx Karthik.. I'll Check it out..
|
|
|
|
|
hi i hv a catalogzone in my page now every time when i clicked on catalog zone iam getting the dropdownlist and the controls to add the webparts.
now in the catalog zone the dropdownlist is comming very big .so how can i add style sheets to the catalog zone dropdownlist or
how can i hide the dropdownlist so that when ever click on add the control automatically add to the webpart zone
|
|
|
|
|
Hi i created a site its working fine...,
to my enduser i dont want to show my full url of the page...,
for ex:
my url is:
http://www.tester.com/memberpage.aspx
but i d like to show this exact url(my page name) followed by my site...,
how to do tht
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
|
Hi All!!
I am trying to display image from database on Asp.Net 2.0 Framework..But my problem is unsolved...The code is:
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
string connectionString = "provider=Microsoft.Jet.OLEDB.4.0;" + @"data source=D:\\image\db.mdb";<br />
OleDbConnection connection2 = new OleDbConnection(connectionString);<br />
string commandString = "Select Image from img where ImageCode = 1";<br />
OleDbCommand command2 = new OleDbCommand(commandString, connection2);<br />
connection2.Open();<br />
byte[] m_objBitmap = (byte[])(command2.ExecuteScalar()); ;<br />
connection2.Close();<br />
<br />
Bitmap BitmapData = BmpDataFromBitmap(m_objBitmap);<br />
MemoryStream ms = new MemoryStream();<br />
Response.ContentType = "image/jpeg";<br />
BitmapData.Save(ms,ImageFormat.Jpeg);<br />
ms.Close();<br />
<br />
}<br />
static public Bitmap BmpDataFromBitmap(byte[] BitmapData)<br />
{<br />
MemoryStream ms = new MemoryStream(BitmapData);<br />
return (new Bitmap(ms));<br />
}<br />
<br />
But i get error "Parameter is invalid" at line:
return (new Bitmap(ms));
I need your kind help..thanx!!
|
|
|
|
|
Is there a way to display checkboxes in a checkbox column in a gridview without defining the datafield? Without a valid datafield the checkbox is not displayed.
|
|
|
|
|
You can add whatever controls you'd like to the datagrid by handling the proper events, like ItemCreated, and inserting them into the row.
only two letters away from being an asset
|
|
|
|
|
I've added a checkbox column to the gridview but at run time there are no checkboxes shown because the datafield property is empty. I do not want to use that property for the checkbox column but I want the checkboxes to display.
modified on Thursday, July 16, 2009 7:20 AM
|
|
|
|
|
I must be missing something. The data field is empty but you still want to bind the column? Is the datagrid set to auto create the columns?
The data column should not be empty, a checkbox is boolean (discounting tri-state checkboxes), so set the data column values to false.
only two letters away from being an asset
|
|
|
|
|
Why do you want only GridView. Gridview will be rendered only when DataField contains something. So I dont like this.
Why dont you use Repeater to render your html?? U can place any control you want and even if it has DBNull, you can change the style of rendering the control easily.
|
|
|
|
|
Abhishek Sur wrote: U can place any control you want and even if it has DBNull
And you can't do this with a grid
only two letters away from being an asset
|
|
|
|
|
I'm reading excel file data using sql bulk copy and uploading the same inside sql server database:
My current code is:
public bool ImportMethod()
{
string sqlConnectionString = "Data Source=192.1.1.10;Initial Catalog=GePReleaseStatus;user=sa;password=sa;Integrated Security=True";
//Create Connection to Excel WorkBook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
connection.Open();
OleDbCommand command = new OleDbCommand("SELECT SrNo AS SrNo,Module AS vcrModule,DefectNoClientName AS intDefectNo, FeratureID AS intFeratureID,Priority AS vcrPriority,Description AS vcrDescription FROM [eContract_4.0.13$]", connection);
using (System.Data.Common.DbDataReader dr = command.ExecuteReader())
{
// Bulk Copy to SQL Server
using (System.Data.SqlClient.SqlBulkCopy bulkCopy = new System.Data.SqlClient.SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "ExcelData";
bulkCopy.WriteToServer(dr);
return true;
}
}
connection.Close();
}
}
Now the problem is:-
1) I'm unable to read the excel, as it has formatted cells at top ?
(common error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005).)
2) how to read the excel from any particular row ?
3) Is it possible to read multiple sheets from a single excel file, how ?
Thanks
raj
|
|
|
|
|
1. If there is simple formatting, you can read it clearly. Otherwise you need InteropServices or other to read anything from anywhere.
2 Indeed you can read from any particular row. Just use
SELECT * FROM [w1$A10:B10]"; where w1 is the sheetname of the excel workbook.
3. Hey, you are calling select statement from your worksheet. So that implies you can ready any worksheet from your workbook, just call the worksheet name properly.
You can have a look at my article
Working with MS Excel(xls / xlsx) Using MDAC and Oledb[^]
It might help you.
|
|
|
|
|
thanks man
raj
|
|
|
|
|
Hello.
I'm just beginning with ASP.NET. I'm developing an application that uses the TcpListener. I've put all network related functions on a separated .cs file, trying to have everything a bit ordered. I use BeginRead method and I need to make the Default page know that some data has arrived in order to process it.
How can I pass a message, generate an event or call a function of the Default page? What's the more proper solution?
I've been reading some tutorials about events and delegates but I'm not able to see how they can work in two separated files...
Thanks in advance.
|
|
|
|
|
You can pass parameters to any page in the URL, something like this Http://myserver/myapp/mypage&ID=123
Where ID is a parameter that will be used by your page.
You retrieve the value of ID by using the following code:
myID = Request.QueryString("ID")
Based on the value of ID, your Page_Load event of your page can make whatever actions are necessary.
Try that.
|
|
|
|
|
Thanks for answering
Does this cause the page to reload? I need something really fast: It's for realtime video.
|
|
|
|
|
Yes. It causes the page to reload. Sounds like you have a more complicated situation.
You might want to give a more detailed explaination of what you are trying to accomplish and the folks here can point you in the right direction.
There may even be a solution aleady developed here or at CodePlex http://www.codeplex.com/[^]
The people here are very helpful.
Good luck with your project.
|
|
|
|