|
When i give in alert, the value is displayed in alert box, but it is empty in code behind.
|
|
|
|
|
Well, your code sucks because it called getElementById and does not check that something was returned. Have you tried what I suggested ? Are you SURE you're using the right client side id ?
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.
|
|
|
|
|
contols i tried,
<asp:hiddenfield id="hdnResolution" runat="server">
and
i try getElementById and getElementsByName also
both giving right result in alert box, but blank in code behind.
A javascrprt error:'Not Implemented' also
|
|
|
|
|
ypki wrote: A javascrprt error:'Not Implemented' also
So there is your issue.
Again, you need to pass the client id through in your script. Just like I told you in my first reply
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.
|
|
|
|
|
|
function SetValue() {
var width = screen.width;
var height = screen.height;
document.getElementById('<%= hdnVal.ClientID %>').value = width+'*'+height;
}
use this function to set value in hiddenfield through javascript.
|
|
|
|
|
How to decrypt the password with is encrypted by sha alg.
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;
|
|
|
|
|
private string Encryption(string strText, string strEncrypt)
{
byte[] byKey = new byte[20];
byte[] dv = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
try
{
byKey = System.Text.Encoding.UTF8.GetBytes(strEncrypt.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputArray = System.Text.Encoding.UTF8.GetBytes(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(byKey, dv), CryptoStreamMode.Write);
cs.Write(inputArray, 0, inputArray.Length);
cs.FlushFinalBlock();
return Convert.ToBase64String(ms.ToArray());
}
catch (Exception ex)
{
throw ex;
}
}
public string encryptPassword(string strText)
{
return Encryption(strText, "&%#@?,:*");
}
public string decryptPassword(string str)
{
return Decrypt(str, "&%#@?,:*");
}
private string Decrypt(string strText, string strEncrypt)
{
byte[] bKey = new byte[20];
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
try
{
bKey = System.Text.Encoding.UTF8.GetBytes(strEncrypt.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
Byte[] inputByteArray = inputByteArray = Convert.FromBase64String(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(bKey, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
return encoding.GetString(ms.ToArray());
}
catch (Exception ex)
{
throw ex;
}
}
Sabari MD
Application Developer
Veloxit Info Solutions
|
|
|
|
|
A hash cannot be decrypted. Instead what you can do, is encrypt what the user entered and see if the two values match.
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,
I have a custom panel control.Now i want to set the databound property of this control.
Can anybody help me with example.
Regards
Pulak
|
|
|
|
|
Hi all.....
This is my oracle statement...while executing its giving an error:
21/29 PL/SQL: ORA-00923: FROM keyword not found where expected
please help me to solve this issue.. its urgent...
create or replace PROCEDURE PEAP_SelectEmpAppraiser
(
AppraiserID IN VARCHAR2 DEFAULT NULL,
Cur_RCT1 OUT GLOBALPKG.RCT1
)
AS
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE PEAP_SelectEmployeesByApr';
INSERT INTO PEAP_SelectEmployeesByApr
SELECT emp_code AS EmployeeID,
emp_code || ' ' || l_name || ' ' || f_name AS SurNameFirstName
FROM emp_master
WHERE (Appraiser = PEAP_SelectEmpAppraiser.AppraiserID);
Insert into PEAP_SelectEmployeesByApr
SELECT emp_code as EmployeeID ,emp_code || ' ' || l_Name || ' ' ||
f_Name AS SurNameFirstName FROM emp_master
WHERE ( Reporting_To = PEAP_SelectEmpAppraiser.AppraiserID) and
isnull ( Appraiser , '') = '' and emp_code not in
( select EmployeeID from PEAP_SelectEmployeesByApr);
OPEN Cur_RCT1 FOR
SELECT DISTINCT
EmployeeID,
SurNameFirstName
FROM PEAP_SelectEmployeesByApr;
END;
/
|
|
|
|
|
This is complex enough that I would break it down. Type it in one part at a time until you find where the error is.
This also has nothing to do with ASP.NET, so it belongs in the SQL forum.
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.
|
|
|
|
|
SELECT emp_code as EmployeeID ,emp_code || ' ' || l_Name || ' ' ||
f_Name AS SurNameFirstName FROM emp_master
WHERE ( Reporting_To = PEAP_SelectEmpAppraiser.AppraiserID) and
isnull ( Appraiser , '') = '' and emp_code not in
( select EmployeeID collate database_default from PEAP_SelectEmployeesByApr)
Error:
PL/SQL: ORA-00923: FROM keyword not found where expected
|
|
|
|
|
Why do you need collate database_default ? What if you remove it ?
You really should move this to the right forum. And if you want to reply to me, you should reply to me, not to yourself.
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.
|
|
|
|
|
can u just tel me which forum i should post this message?...
and if i remove collate database_default am getting this error:
PL/SQL: ORA-00933: SQL command not properly ended
|
|
|
|
|
sandhya14 wrote: SELECT emp_code as EmployeeID ,emp_code || ' ' || l_Name || ' ' ||
f_Name AS SurNameFirstName FROM emp_master
WHERE ( Reporting_To = PEAP_SelectEmpAppraiser.AppraiserID) and
isnull ( Appraiser , '') = '' and emp_code not
I assume that the Reporting_To, Appraiser and emp_code columns belong to emp_master table.
Also you are comparing Reporting_To column to the column of PEAP_SelectEmpAppraiser table. But this table is not in the FROM clause.
|
|
|
|
|
Hi,
In my content page of asp.net website i have a radiobuttonlist for which i am writing javascript code on its onclick.
i.e. rbt1.items(0).attributes.add("onclick","function1(parameters);")
It was working fine before i placed it inside an updatepanel. But as soon as i placed this control inside updatepanel the javascript function stopped working. Although it still works in firefox but not working in IE.
If anyone can suggest what can be the problem. Is there a problem in html or browser compatibility issue?
Thanks,
sabiha.
|
|
|
|
|
hozsam wrote: Is there a problem in html or browser compatibility issue?
Obviously. I guess the script that is emitted by the ASP.NET AJAX framework differs, or an IE/FF difference is killing it.
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.
|
|
|
|
|
so can you pls provide solution for the same. So that it works for both IE and FF.
|
|
|
|
|
<asp:ListView ID="lvCustomers" runat="server" DataSourceID="odsTotalStudents"
onitemcommand="lvCustomers_ItemCommand">
<LayoutTemplate>
<table id="customers" runat="server" class="grid" cellspacing="0" border="0">
<tr>
<th />
<th>
<asp:LinkButton ID="btnSortEmail" runat="server" Text="Admission No." CommandName="Sort"
CommandArgument="admissionno" />
</th>
<th>
<asp:LinkButton ID="btnSortFirstName" runat="server" Text="First Name" CommandName="Sort"
CommandArgument="firstname" />
</th>
<th>
<asp:LinkButton ID="btnSortLastName" runat="server" Text="Last Name" CommandName="Sort"
CommandArgument="lastname" />
</th>
<th>
<asp:LinkButton ID="btnSortGender" runat="server" Text="Class" CommandName="Sort"
CommandArgument="class_section" />
</th>
</tr>
<tr id="itemPlaceholder" runat="server" />
<tr class="pager">
<td colspan="6">
<div class="container">
<asp:DataPager ID="pager" runat="server" PageSize="15">
<Fields>
<asp:TemplatePagerField OnPagerCommand="PagerCommand">
<PagerTemplate>
<div class="command">
<asp:ImageButton ID="btnFirst" runat="server" CommandName="First" ImageUrl="~/images/first.gif"
AlternateText="First Page" ToolTip="First Page" />
<asp:ImageButton ID="btnPrevious" runat="server" CommandName="Previous" ImageUrl="~/images/prev.gif"
AlternateText="Previous Page" ToolTip="Previous Page" />
</div>
<div class="command">
<asp:TextBox ID="txtSlider" runat="server" Text='<%#
Container.TotalRowCount > 0
? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows))
: 0
%>' AutoPostBack="true" OnTextChanged="CurrentPageChanged" Style="visibility: hidden" />
<cc1:SliderExtender ID="slider" BehaviorID="slider" runat="server" TargetControlID="txtSlider"
Orientation="Horizontal" Minimum="1" Maximum='<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows) %>'
TooltipText='<%# "Page {0} of " + Math.Ceiling ((double)Container.TotalRowCount / Container.MaximumRows).ToString() + " (" + Container.TotalRowCount + " items)" %>' />
</div>
<div class="command">
<asp:ImageButton ID="btnNext" runat="server" CommandName="Next" ImageUrl="~/images/next.gif"
AlternateText="Next Page" ToolTip="Next Page" />
<asp:ImageButton ID="btnLast" runat="server" CommandName="Last" ImageUrl="~/images/last.gif"
AlternateText="Last Page" ToolTip="Last Page" />
</div>
<div class="info">
Page <b>
<%# Container.TotalRowCount > 0 ? Math.Ceiling(((double)(Container.StartRowIndex + Container.MaximumRows) / Container.MaximumRows)) : 0 %>
</b>of <b>
<%# Math.Ceiling((double)Container.TotalRowCount / Container.MaximumRows)%>
</b>(<%# Container.TotalRowCount %>
items)
</div>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>
</div>
</td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<asp:Panel ID="pnl_Details" runat="server" >
<tr id="row" runat="server" class='<%# Container.DataItemIndex % 2 == 0 ? "row" : "altrow" %>'>
<td class="rownum">
<%# Container.DataItemIndex + 1 %>
</td>
<td>
<asp:Label ID="lbl_StudentAddmission" runat="server" Text='<%# Eval("AdmissionNo")%>'></asp:Label>
</td>
<td>
<%# Eval("firstname")%>
</td>
<td>
<%# Eval("lastname")%>
</td>
<td>
<asp:Label ID="lbl_Class_Section" runat="server" Text='<%# Eval("Class_Section")%>'></asp:Label>
</td>
</tr>
</asp:Panel>
<cc1:HoverMenuExtender ID="HoverMenuExtender1" PopupPosition="Right" TargetControlID="pnl_Details" PopupControlID="pnl_Popup" PopDelay="25" runat="server">
</cc1:HoverMenuExtender>
<asp:Panel ID="pnl_Popup" runat="server">
<asp:LinkButton ID="lbtn_Allot" runat="server" CommandName="Allot" CommandArgument='<%# Eval("AdmissionNo")%>' Text="Allot"></asp:LinkButton>
<asp:LinkButton ID="lbtn_CancelAllotment" runat="server" CommandName="Cancel" CommandArgument='<%# Eval("AdmissionNo")%>' Text="Cancel Allotment"></asp:LinkButton>
</asp:Panel>
</ItemTemplate>
</asp:ListView>
list view hover menu extender not working when mouse hover.can anybody help me regarding this
hi
|
|
|
|
|
Am getting "RPC Server is Unavailable" error .
Any solution
My application is ASP.net + c#
Sabari MD
Application Developer
Veloxit Info Solutions
|
|
|
|
|
Just google it.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I have three different ways to Instatiate a class and fill the properties.
Even though all three ways work I'm not sure which would be the best to use in the form "Best Practices"
Method 1
Simple instantiate class, set property and call select to fill object
Foo NewFoo = new Foo();
NewFoo.ID = 10;
NewFoo.Select();
Method 2
In constructor Set Id and then call Select to Fill Object
Foo NewFoo = new Foo(10).Select();
Method 3
In the construtor I use the ID and automatically call the Select to fill the Object
Foo NewFoo = new Foo(10);
All three are basically the same. If anyone does it differently or better.
Please let me know what your thoughts are.
Thanks.
|
|
|
|
|
I would use Method 4
Foo NewFoo = new Foo(10);
NewFoo.Select();
|
|
|
|