|
thanks a lot...shall i start my project with Ajax tool kit itself?
Ramkumar(senior pgmr)
|
|
|
|
|
Yes , you can procced with it.
Regards
Anil Pal
|
|
|
|
|
I have to add the facilities of adding water mark on video files.
I am developing my application in c#.
any body help me for the same.
Thanks In advance.
|
|
|
|
|
Don't cross post. ASP.NET can't watermark a video, so asking in the C# forum, as you have done, is the right thing to do.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Dear Experts,
Do you have any idea encrypted string in Java and decrypt in asp.net using the same AES algorithm?
|
|
|
|
|
Sure - if it's the same algorithm, that should work just fine.
Help me is a stupid subject line. Everyone here wants help.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am trying to decrypt the string in asp.net which is encryted in java.I am able to do it till some extent but its not completely decrypting.
Here i am putting the code of both (Decryption through ASP.NET and Encryption through Java)
private String Encrypt() /// Done in Java return encryted string
{
String hexString="";
String msg="Sample Input Text";
SecretKeySpec skeySpec ="GbxDwxcjvjtpi0+lQuyfHg=="; // Autogennerate Key
try
{
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted = cipher.doFinal(msg.getBytes());
hexString=asHex(encrypted);
}
catch(Exception e)
{
System.out.println("Error in Encrypt"+e);
}
return hexString;
}
private void DecryptFunction() // Done in Asp.net
{
try
{
string strEncrypt = "fc8caff8581f9a3920b788490c3569ffb345e54c7f72a73ddb76256ff81fbfd6";// Encrypt string
string AutoKey= "GbxDwxcjvjtpi0+lQuyfHg==";
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = Encoding.UTF8.GetBytes(AutoKey= );
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform crypt = tdes.CreateDecryptor();
byte[] cipher = FromHex(strEncrypt);
byte[] plain = crypt.TransformFinalBlock(cipher, 0, cipher.Length); // Here Error showing
Response.Write("Decryped string : " + System.Text.Encoding.UTF8.GetString(plain) + "<br/><br/><br/><br/>");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
Here decryt function should be return decrypt string means Sample Input Text but its showing Bad Data error.
I give error screen shot also.
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------
Bad Data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: Bad Data.
Source Error:
Line 76: ICryptoTransform crypt = tdes.CreateDecryptor();
Line 77: byte[] cipher = FromHex(strEncrypt);
Line 78: byte[] plain = crypt.TransformFinalBlock(cipher, 0, cipher.Length); // Here Error showing
Line 79: Response.Write("Decryped string : " + System.Text.Encoding.UTF8.GetString(plain) + "<br/><br/><br/><br/>");
Line 80:
Source File: c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs Line: 78
Stack Trace:
[CryptographicException: Bad Data.
]
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) +33
System.Security.Cryptography.Utils._DecryptData(SafeKeyHandle hKey, Byte[] data, Int32 ib, Int32 cb, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode PaddingMode, Boolean fDone) +0
System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +200
SSoFinal.DecryptFunctionINGData() in c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs:78
SSoFinal.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
I would appreciate some help
Regards
Mani
|
|
|
|
|
Hy,
I m using query sring to pass value to another page. can any one tell me how to encrypt the query string value and then decrypt it on the other page
|
|
|
|
|
Use the Cryptography namespace to encrypt and decrypt strings.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Follow the below steps: I am posting with small exmaple
A.Code in sender page of uery string
1.string strID = "A0123456789";
2. Response.Redirect("../Search/DocumentSearch.aspx?ID=" + Encrypt(strID));
3.public string Encrypt(string strValue)
{
string encryptedResult = String.Empty;
string passPhrase = "Pas5pr@se";
string saltValue = "s@1tValue";
string hashAlgorithm = "SHA1";
int passwordIterations = 2;
string initVector = "@1B2c3D4e5F6g7H8";
int keySize = 256;
byte[] initVectorBytes;
initVectorBytes = Encoding.ASCII.GetBytes(initVector);
byte[] saltValueBytes;
saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] plainTextBytes;
plainTextBytes = Encoding.UTF8.GetBytes(strValue);
PasswordDeriveBytes password;
password = new PasswordDeriveBytes(passPhrase, saltValueBytes, hashAlgorithm, passwordIterations);
byte[] keyBytes;
keyBytes = password.GetBytes((keySize / 8));
RijndaelManaged symmetricKey;
symmetricKey = new RijndaelManaged();
symmetricKey.Mode = CipherMode.CBC;
ICryptoTransform encryptor;
encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes);
MemoryStream memoryStream;
memoryStream = new MemoryStream();
CryptoStream cryptoStream;
cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write);
cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
cryptoStream.FlushFinalBlock();
byte[] cipherTextBytes;
cipherTextBytes = memoryStream.ToArray();
memoryStream.Close();
cryptoStream.Close();
string cipherText;
cipherText = Convert.ToBase64String(cipherTextBytes);
return cipherText;
}
B. Code in receiver page of querystring
1.string strID = Request.QueryString["ID"].ToString();
string plainValue= Decrypt(strID);
2. public string Decrypt(string encryptedResult)
{
string passPhrase = "Pas5pr@se";
string saltValue = "s@1tValue";
string hashAlgorithm = "SHA1";
int passwordIterations = 2;
string initVector = "@1B2c3D4e5F6g7H8";
int keySize = 256;
byte[] initVectorBytes;
initVectorBytes = Encoding.ASCII.GetBytes(initVector);
byte[] saltValueBytes;
saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] cipherTextBytes = new byte[encryptedResult.Length] ;
cipherTextBytes = Convert.FromBase64String(encryptedResult);
PasswordDeriveBytes password;
password = new PasswordDeriveBytes(passPhrase, saltValueBytes, hashAlgorithm, passwordIterations);
byte[] keyBytes;
keyBytes = password.GetBytes((keySize / 8));
RijndaelManaged symmetricKey;
symmetricKey = new RijndaelManaged();
symmetricKey.Mode = CipherMode.CBC;
ICryptoTransform decryptor;
decryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes);
MemoryStream memoryStream;
memoryStream = new MemoryStream(cipherTextBytes);
CryptoStream cryptoStream;
cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read);
byte[] plainTextBytes= new byte [encryptedResult.Length ] ;
//object plainTextBytes;
int decryptedByteCount;
decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
memoryStream.Close();
cryptoStream.Close();
string plainText;
plainText = Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount);
return plainText;
}
Cheers!
Regards
Anil Pal
|
|
|
|
|
instead of encrypt the query string you have to use the urlrewriting.
so that you can get exact url.
Regards,
Keyur Satydev
|
|
|
|
|
Crystal Report working in IDE 2008 but when i publish web project
and try to run it from IIS 5.0 I got this kind of error.
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'UserName\ASPNET'. SQL State: 42000
Please help me in this matter
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
give permission to ASPNET to the database you are login...
Create a login and give permission to that database on your server.
Abhishek Sur
|
|
|
|
|
Insert Runtime Row in Gridview Control using C#
|
|
|
|
|
Vishal09 wrote: Insert Runtime Row in Gridview Control using C#
Ok. Now what's the question? Please read the posting guidelines before you post all the crap here.
|
|
|
|
|
|
test successful. You ARE a moron after all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi..
i have a DataTable dt width data
Id Price
1 250
2 200
3 300
DataSet ds = new DataSet();
ds.Tables.Add(dt);
XmlDataDocument x = new XmlDataDocument(ds);
and a procedure in sql server 2005
create procedure Sproc_Select_Xml(@x xml)
AS
BEGIN
DECLARE @data TABLE(Id bigint,Price numeric)
INSERT INTO @data(Id,Price)
SELECT xmlVals.rowvals.query('Id').value('.','bigint'),
xmlVals.rowvals.query('Price').value('.','numeric')
FROM @x.nodes('/ds/dt') as xmlVals(rowvals)
SELECT * FROM @data
END
when i pass xml document to proc
i get the error
System.ArgumentException: No mapping exists from object type System.Xml.XmlDataDocument to a known managed provider native type.
|
|
|
|
|
The error means what it says. Don't pass in the XML document, pass in the XML.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yep u right thanx
i need to pass
ds.GetXml ()
|
|
|
|
|
I have a gridview in an updatepanel (I need this for a partial page postback on sort and paging). I also have a buttonField in my gridview and a panel(div) outside the updatepanel.
How do I hide and show the panel when the buttonField is clicked? My code works without the updatepanel but does not work with the updatepanel. I'm obviously missing something. Any help would be greatly appreciated.
My code structure below:
<asp:UpdatePanel ID="updPnlEmployee" runat="server">
<ContentTemplate>
<asp:GridView ID="grdVWEmployee" runat="server" AllowPaging="True" AllowSorting="True" PageSize="50" AutoGenerateColumns="False" DataKeyNames="Employee_ID" DataSourceID="odsEmployee" OnRowDataBound="grdVWEmployee_RowDataBound" OnRowCommand="grdVWEmployee_RowCommand">
<Columns>
<asp:BoundField DataField="First_Name" HeaderText="First Name" SortExpression="First_Name"/>
<asp:BoundField DataField="Last_Name" HeaderText="Last Name" SortExpression="Last_Name"/>
<asp:ButtonField Text="Eligibility" CommandName="Eligibility" CausesValidation="false"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlGrid" runat="server" CssClass="detail" width="500px" style="display:none">
</asp:Panel>
CODE BEHIND:
protected void grdVWEmployee_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Eligibility")
{
this.pnlGrid.Visible = true;
}
}
|
|
|
|
|
use after
<triggers><asp:postbacktrigger controlid="pnlGrid" xmlns:asp="#unknown">
|
|
|
|
|
Hi,
Thanks for your response, I tried your suggestion but I got the following error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Type 'System.Web.UI.PostBackTrigger' does not have a public property named 'xmlns:asp'.
|
|
|
|
|
I finally got this to work.
I changed the field into a template field and created a LinkButton.
OnRowCreated, I registered the button as a postback control.
protected void grdVWEmployee_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//Retrieve Item Number column and register button as normal postback
LinkButton btnEligibility = (LinkButton)e.Row.FindControl("btnEligibility");
ScriptManager sm = ScriptManager.GetCurrent(this);
if (sm != null)
{
sm.RegisterPostBackControl(btnEligibility);
}
}
}
|
|
|
|
|
Hello guys!
can anybody give me a list of projects that are deeloped using share point technology.so that I'll practise the microsoft office share point.
thank you
valli
valli
|
|
|
|