|
hi
i am using two dropdownlist boxes in my application.the values of one box are append directly from data base in my application.on change of first drop down list i display the vaues of second drop down by using ajax,here for second drop down values are in another page i opened that in ajax,
but here problem is the value of second dropdown is not displayed at page load.plz solve the problem asap.
regards
venkat
|
|
|
|
|
You're writing your own ajax ? You're opening another page that has the second dropdown ? How are you trying to set the selected value in this page, via the URL ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This is from Chandrakanth.
I need some Guidance regarding Dynamic Generic XL Upload With Validation.
Can any one give me some suggestion for this Dynamic Generic XL Upload in C#.
That means in MY Excel sheet in non -specific fields that means...
In my excel sheet fields are not fixed it may be 5 columns,it may be 10 columns.
I have to do this excel uploading with validation ,, while I am doing this excel upload I have to map with stored procedure.. and column data types...
Developer does not involve on every uploading coding part...that means we have to facilitate to end user
Excel uploading any file regardless of fields and data types has to upload with validation...
We have to make general Excel Uploading ,,,,,, with validation using SSIS feature in SQL SERVER 2005
If u have any Idea(any other logic) to do generic excel uploading,,please share with me ...
Thanks in Advance
Chandrakanth.Gaddam
Chandrakanth
|
|
|
|
|
Hi There,
I need your help in the following, i have a web application in server A, which in turn call another application in server B, to upload a file in server B, now the upload part is working fine after upload i have return a Java script to close the window once the upload is completed, the script is not working...below is the script.
private void CloseSelf()
{
//Spit Startup Script to the Page to show the error message
Page.RegisterStartupScript( "CloseSelfWindow", @"
") ;
}
i even tried another script just in Server B
private void closeSelf1()
{
Page.RegisterStartupScript("PopupScript",
"javascript:window.opener='x';window.close();");
}
the above script is working when am opening the page in server B but it not working when am opening the page in server A...
any suggestion or help, please do the needful...Thank for your time.
regards
Ybasha
|
|
|
|
|
Sounds like you have a scrpt on serverA and you want it to run on serverB ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No the script is in the application which deployed in server B which in turn am calling through server A main application.
|
|
|
|
|
Display monthly data on the webform 54mins ago
Hello All,
I have a simple rek to display monthy data count for a table. I wish to know the best method to achieve this. Should I use a reporting tool of should display it by fetching the data from the database and create a bar graph.
I am able to pull the data from the database with two columns Month, DataCount. Now i want to display this data in the fom of a bar graph.
I am getting all types of example to create a bar graph from array list. Now I wish to use my dataset to draw the bar graphs. Can anyone help. the data wud be like
Months Data
1 5
2 3
3 7
4 9
5 0
.
.
.
.
.
.
12 40
Please help.
Thanks
|
|
|
|
|
I'd just create a bar graph using one of the free tools that exist, or write my own. A bar graph is easy to draw.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Chris,
Can you show me how to do that with data from dataset.
Thanks
|
|
|
|
|
I'd expect you'd do it in the database. That's what the database is for.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Chris,
That is something I would have to do at the front end through the code.
To start with that is the thing I am unable to do and looking for some code to dra a bar graph from the dataset that I get from the database
Thanks
-- modified at 13:54 Monday 8th October, 2007
|
|
|
|
|
Now i am in a condition, Where I am just displaying the month names and numbers. There is a small issue. I need to get month names instead of month numbers from Oracle.
here's my query
SELECT Count(*),EXTRACT (MONTH FROM DATE_CREATED),EXTRACT (YEAR FROM DATE_CREATED) FROM MyTable GROUP BY EXTRACT (YEAR FROM DATE_CREATED) ,EXTRACT (MONTH FROM DATE_CREATED)
And the result is 3 columns. Count, Month(Number) and year
something like this
3 10 2006
Please anyone help to convert the month number to month name in oracle or C#. Problem is I cannot use the data formatting functions as this is a single number appearing.
Thanks for any help!!!!!!!!!!!!!!!
|
|
|
|
|
I got my soluin...i posting it here for someone who may need it!!!!!!!!!!!!!!
Select count(*), EXTRACT (MONTH FROM DATE_CREATED),to_char(date_created,'MONTH')month_created FROM MyTable WHERE EXTRACT (YEAR FROM DATE_CREATED) = '2007' GROUP BY EXTRACT (MONTH FROM DATE_CREATED) ,to_char(date_created,'MONTH')
|
|
|
|
|
You mean the ON DELETE SET NULL option in SQL 2005? I don't think there is an equivalent in Access. You should probably run an UPDATE query on your foreign key field before your DELETE query to set any values related to this picture to NULL.
Paul Marfleet
|
|
|
|
|
please have a look to my code.I always have error invalid user name or passwprd , can you help me please.if oyu want me to send you the whole project please let me know.
private void Page_Load(object sender, System.EventArgs e)
{
}
private static string CreateSalt(int size)
{
// Generate a cryptographic random number using the cryptographic
// service provider
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
byte[] buff = new byte[size];
rng.GetBytes(buff);
// Return a Base64 string representation of the random number
return Convert.ToBase64String(buff);
}
private static string CreatePasswordHash(string pwd, string salt)
{
string saltAndPwd = String.Concat(pwd, salt);
string hashedPwd =
FormsAuthentication.HashPasswordForStoringInConfigFile(
saltAndPwd, "SHA1");
hashedPwd = String.Concat(hashedPwd, salt);
return hashedPwd;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.btnLogon.Click += new System.EventHandler(this.btnLogon_Click);
this.btnRegister.Click += new System.EventHandler(this.btnRegister_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnRegister_Click(object sender, System.EventArgs e)
{
int saltSize = 5;
string salt = CreateSalt(saltSize);
string passwordHash = CreatePasswordHash(txtPassword.Text,salt);
try
{
StoreAccountDetails( txtUserName.Text, passwordHash);
}
catch(Exception ex)
{
lblMessage.Text = ex.Message;
}
}
private bool VerifyPassword(string suppliedUserName,
string suppliedPassword )
{
bool passwordMatch = false;
// Get the salt and pwd from the database based on the user name.
SqlConnection conn = new SqlConnection( "Server=(local);" +"Integrated Security=SSPI;" + "database=UserAccounts");
SqlCommand cmd = new SqlCommand( "LookupUser", conn );
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter sqlParam = cmd.Parameters.Add("@userName",
SqlDbType.VarChar,
20);
sqlParam.Value = suppliedUserName;
try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read(); // Advance to the one and only row
// Return output parameters from returned data stream
string dbPasswordHash = reader.GetString(0);
int saltSize = 5;
string salt =
dbPasswordHash.Substring(dbPasswordHash.Length - saltSize);
reader.Close();
// Now take the password supplied by the user
// and generate the hash.
string hashedPasswordAndSalt =
CreatePasswordHash(suppliedPassword, salt);
// Now verify them.
passwordMatch = hashedPasswordAndSalt.Equals(dbPasswordHash);
}
catch (Exception ex)
{
throw new Exception("Execption verifying password. " +
ex.Message);
}
finally
{
conn.Close();
}
return passwordMatch;
}
private void StoreAccountDetails( string userName,
string passwordHash )
{
// See "How To Use DPAPI (Machine Store) from ASP.NET" for information
// about securely storing connection strings.
SqlConnection conn = new SqlConnection( "Server=(local);" + "Integrated Security=SSPI;" +
"database=UserAccounts");
SqlCommand cmd = new SqlCommand("RegisterUser", conn );
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter sqlParam = null;
//Usage of Sql parameters also helps avoid SQL Injection attacks.
sqlParam = cmd.Parameters.Add("@userName", SqlDbType.VarChar,
20);
sqlParam.Value = userName;
sqlParam = cmd.Parameters.Add("@passwordHash ", SqlDbType.VarChar,
40);
sqlParam.Value = passwordHash;
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch( Exception ex )
{
// Code to check for primary key violation (duplicate account
// or other database errors omitted for clarity
throw new Exception("Exception adding account. " + ex.Message);
}
finally
{
conn.Close();
}
}
private void btnLogon_Click(object sender, System.EventArgs e)
{
bool passwordVerified = false;
try
{
passwordVerified =
VerifyPassword(txtUserName.Text,txtPassword.Text);
}
catch(Exception ex)
{
lblMessage.Text = ex.Message;
return;
}
if (passwordVerified == true )
{
lblMessage.Text = "Logon successful: User is authenticated";
}
else
{
lblMessage.Text = "Invalid username or password";
}
}
|
|
|
|
|
insert below code to your page load method:
**************
if(!IsPostBack)
{
//your special code that must be run for first time in loading of page
//if you have not any code for here so leave empty.
}
**************
try it...hope to successfully.
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
|
Hi all,
my project is based on inserting and retrieving video files (type :MPEG)
I'm using ASP.NET2.0 and SQL SERVER 2005
my question is how can I insert video files in the database????
bleave in your self
|
|
|
|
|
This question has nothing to do with ASP.NET. The ASP.NET part would be 'how do I upload video files'. You realise that unless you serve the video files without any other HTML, you can't serve them from the database ? It's probably better to store the path to a video on your file system. Having said that, you can store them as a blob.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi friend's
how can i access to the selected value property of a dropdownlist control with javascript?
as you know dropdownlist is a server control
although,i know a method that allow me to access a property of a server control such as checkbox or optionbox but this method doesn't work for drop downlist:
============================================================================
var chk_MainUser=document.getElementById('<%= rb_Users.ClientID %>');
alert(chk_MainUser.getAttribute("checked"));
============================================================================
if you know a technique for it please tell me...
thank you.
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
mr.mohsen wrote: i know a method that allow me to access a property of a server control such as checkbox or optionbox
No, you don't. You can't access any server control at all from Javascript. The code is accessing the html elements that the server control has rendered.
The server controls only exist on the server to create the html page. Once the page is created and sent to the browser, the server controls doesn't exist any more.
mr.mohsen wrote: how can i access to the selected value property of a dropdownlist control with javascript?
You can't. You have to access the properties of the html elements that the control has rendered. Use the selectedIndex property to get the index of the selected item, then use that to get the value of the selected item.
Example:
var sel = document.getElementById('idOfTheSelectElement');<br />
var value = sel.options[sel.selectedIndex];
---
single minded; short sighted; long gone;
|
|
|
|
|
thank you Guffa
befor i test your code i want to ask you about the realation of server and client:
i want to call a javascript function from server-side,it means when my page is loading,i want to call a specific function(javascript function).how can i do it?do you know?
thank you for your answer.
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
When your server side code generates the script for the page, it can generate script to call the method in question when the page loads.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a asp:CompleteWizardStep after creating my user. When registration reaches this step there is a continue button. How do not have the continue button to be there, I don't want it there at all. I just want a thank you message. Also, the continue button is to the right, how do I have it left aligned because my asp:CreateUserWizard has a width of a 100%.
Please can someone help??
Regards
|
|
|
|
|
this small side from the problem if iput this code in code behind of asp page
protected void Page_Load(object sender, EventArgs e)
{
Image1.ImageUrl = Server.MapPath(@"images/1.jpg");
Image1.DataBind();
}
it will work in microsoft internet explorer and won't work in opera and firefox???
any body can help???
|
|
|
|