|
Use getEnumerator() method in hashtable object and loop till the end of that. Create rows in datatable and assign hashtable value.
|
|
|
|
|
can any one tell me how to validate a Asp control on keypress in asp.net.
I have to restrict users from entering numerices,I have done it using Html control key press and then adding runat=server tag to it,but I would like to know where its possible in asp.net server controls.
Thanks in Advance.
|
|
|
|
|
You mean asp.net textbox control if so then you can do it same way as you did for your html control.
Apurva Kaushal
|
|
|
|
|
|
Always welcome..
Apurva Kaushal
|
|
|
|
|
There are many ways you can prevent users from entering something u don't want.
1. You can user either Custome validator or Regular expression validator.
2. In Java script you can write:
(on page load)
TextBox1.Attributes.Add("onKeyUp","javascript:validate(this.value)");
then in function validate() you can perform the validation,
if value is this
then delete
hope this helps.
|
|
|
|
|
Hai,
I want to know how to find out the duration of a flv file or any video file.Am using mediahandler to convert video files to flv.Please help me....
jincy
|
|
|
|
|
Hi...
How can I perform a DoubleClick Event in a ListBox Using JavaScript in Asp.Net 2.0
expecting reply
Mahesh.J
-- modified at 1:25 Friday 13th July, 2007
|
|
|
|
|
You can add this atribute to the ListBox (on page load)
ListBox1.Attributes.Add("onDBlClick", "javascript:Perform()");
and in the Javascript Perform() function you can do whatever you want.
|
|
|
|
|
|
It is users.sql :
use NHibernate
go
CREATE TABLE users (
LogonID nvarchar(20) NOT NULL default '0',
Name nvarchar(40) default NULL,
Password nvarchar(20) default NULL,
EmailAddress nvarchar(40) default NULL,
LastLogon datetime default NULL,
PRIMARY KEY (LogonID)
)
go
It is users.cs :
using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
namespace NHibernate.Examples.QuickStart
{
public class User
{
private string id;
private string userName;
private string password;
private string emailAddress;
private DateTime lastLogon;
public User()
{
}
public string Id
{
get { return id; }
set { id = value; }
}
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
public DateTime LastLogon
{
get { return lastLogon; }
set { lastLogon = value; }
}
}
//interface ISession
//{
// void save(users newUser);
// void Save(users newUser);
//}
}
It is User.hbm.xml :
using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
namespace NHibernate.Examples.QuickStart
{
public class User
{
private string id;
private string userName;
private string password;
private string emailAddress;
private DateTime lastLogon;
public User()
{
}
public string Id
{
get { return id; }
set { id = value; }
}
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
public DateTime LastLogon
{
get { return lastLogon; }
set { lastLogon = value; }
}
}
//interface ISession
//{
// void save(users newUser);
// void Save(users newUser);
//}
}
It is App.config :
<configuration>
<configsections>
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider">
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect">
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver">
<add key="hibernate.connection.connection_string" value="Data Source=dev2;Initial Catalog=NHibernate;User ID=sa;Password=buyagift;">
It is Programs.cs :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace NHibernate
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new NHibernate.Form1());
Application.Run(new NHibernate.Examples.QuickStart.Form1());
}
}
}
This code generates following error:
Unknown entity class: NHibernate.Examples.QuickStart.User
Can anyone help me please?
Thanks
shoaib
|
|
|
|
|
It will be easy if you can give us the line where your code is falling over, rather than posting the whole application in here
|
|
|
|
|
Hi, I'm trying to debug my app after an exception has been thrown. The problem I'm having is I don't know whether I'm using the debugging tools correctly. I used the Step Into option after placing a break point on the first line inside of a function. Then the exception is shown and the line where the exception occurs is also shown in a popup window. The message in the popup window also says to review the Trace Stack. Now I'm not sure if the Trace Stack is the popup window that has the label Output on it. If it is I'm in alot of trouble 'cause I don't understand a thing it is saying. Please explain how I can display the Trace Stack if the afore mentioned popup window is not it. Thank you in advance for your help.
|
|
|
|
|
ASPnoob wrote: Please explain how I can display the Trace Stack if the afore mentioned popup window is not it
The stack trace is shown in the window. If you showed us some code and the exception message, we cold probably help.
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 )
|
|
|
|
|
Thanks for replying, I've sort of gotten it to work. What I forgot to do was I forgot to use the if statement in the Page Load to determine if myCon is null when no list item is selected. I did use the if statement for that purpose in the Button1_Click part of my app. The problem now though is I see a box generated when I run my app but there is nothing in it. The box is supposed to display data retrieved from the database. The following is my code.
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button1.Click<br />
Dim myCon As OdbcConnection<br />
Dim i As Integer<br />
Dim cmd As OdbcCommand<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
<br />
myCon = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDatabase;User=myUser;Password=myPass;Option=3;")<br />
cmd = New OdbcCommand("SELECT * FROM myTable where Professions = '" & ListBox2.Items(i).Text & "'")<br />
<br />
End If<br />
Next<br />
If Not IsNothing(myCon) Then<br />
myCon.Open()<br />
<br />
cmd.Connection = myCon<br />
<br />
Dim ds As New DataSet<br />
<br />
Dim ad As New OdbcDataAdapter(cmd)<br />
<br />
ad.Fill(ds)<br />
<br />
Me.ListBox2.DataSource = ds<br />
<br />
Me.ListBox2.DataTextField = "Professions"<br />
<br />
Me.ListBox2.DataBind()<br />
End If<br />
End Sub<br />
-- modified at 1:34 Friday 13th July, 2007
|
|
|
|
|
good day guyz, greetings to all...
need help again from you....
my problem was:
how to adjust the datagrid row height?
in runtime/ codes...
.. sample codes or links are highly appreciated.
thank you again
start a new beginning in every ending; thats what life for......
|
|
|
|
|
You can set the itemstyle height="". You should assign a certain height to each row in your datagrid,absolutly position not relatively position,so that the datagrid will be located in a certain position as you wish
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
How to change Datagrid Header Text through programming in C#.net.
and how to set colunm width and height. How to format date in datagrid column.
and I want to highlight row where cell fee value = 0;
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
The following is the Javascript i used for selecting all the checkboxex in a Datagrid,using this code i could select all the checkbox.
function CheckAllDataGridCheckBoxes(aspCheckBoxID, checkVal)
{
re = new RegExp(':' + aspCheckBoxID + '$') //generated control name starts with a colon
for(i = 0; i < form1.elements.length; i++)
{
elm = document.forms[0].elements[i]
if (elm.type == 'checkbox')
{
if (elm.name=aspCheckBoxID)
{
elm.checked = checkVal;
}
}
}
}
but my problem is i want to take the selected rows cells value,the button event as follows
foreach (DataGridItem item in dgPhotos.Items)
{
CheckBox chkBox = (CheckBox)item.FindControl("chkItem");
if (chkBox.Checked)
{
File.Delete(item.Cells[2].Text);
}
}
in this event chkbox.Checked is showing false,checkboxex are checked even though am getting chkBox.Checked=false.
but if i select the checkbox one by one am getting correctly
then chkbox.Checkbox=true only the problem is if i use Javascript.what is the problem.How can i solve this problem.
|
|
|
|
|
Write if (elm.name==aspCheckBoxID) intead of if (elm.name=aspCheckBoxID)
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
I used, if (elm.name==aspCheckBoxID) then it will not check.
|
|
|
|
|
==Microsoft visual studio .NET 2003
==Asp.net With C#, Web appliation
==Create Crystal Report
What is the problem ? How to solve it? Can you help me, Please........
Input::
private void Page_Load(object sender, System.EventArgs e)
{
CrystalReportViewer1.ReportSource=Server.MapPath("")+"\\CrystalReport1.rpt";
}
=========================================================================================
Output::
Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
|
|
|
|
|
Sounds like you need log on credentials.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hello again,
I need help trying to get this to work.
I want to disable a button when clicked, so that the user doesn’t clicking it again.
<script language="javascript" type="text/javascript">
function Form1_onSubmit() {
Form1.btnSaveBudget.disabled=true;
}
...
However, when the button gets disabled then the click event won’t work.
Protected Sub btn_Click(...) Handles btn.Click
I need the click event to fire to do something.
Thank you
|
|
|
|
|
Hey I am not a JS expert but here are some suggestions:
Is the on_submit function not meant to return a value? Does returning true make it work. Does it post back at all?
If this doesnt sort it how about instead of disabling it just ignoring it so you would set a bool to true on first press then on further presses check this value and ignore the event.
Hope this helps
Dan
|
|
|
|