|
I am using AjaxFileUploader to upload multiple files in my ASP.net project.
I want to validate RequiredFieldValidator on It, Means at least one file must be Upload before submit Form.
My Code is:
<ajaxtoolkit:ajaxfileupload
id="ajaxUpload1" throbberid="MyThrobber1" maximumnumberoffiles="5" runat="server" allowedfiletypes="jpg,png">
How can validate this control as Requiredfiled, because Simple RequiredFieldValidator does not work on it.
is there any other solution ???
|
|
|
|
|
Hitesh Vaghasiya wrote: I am using AjaxFileUploader to upload multiple files in my ASP.net project. Then you should be using the ASP.NET forum.
Veni, vidi, abiit domum
|
|
|
|
|
Thanks for reply.
i have already find to asp.net forum.
but i can't got the solution.
if possible than please help me.
i am using VS 2010 and Ajax Toolkit 4.0.
If server side validation possible for that control than please send me code for that also.
Thanks Again ...
|
|
|
|
|
I don't know ASP.NET, which is why I told you to post your question in that forum. This one is for C# questions.
Veni, vidi, abiit domum
|
|
|
|
|
Are integration tests worth the trouble?
I personally don't like integration tests, or at least not when they're mixed in with unit tests. They are much more costly than unit tests and their benefit seems to be minimal. There was a time when I had to write lots of them for legacy code. They were complicated, took ages to write, forever breaking, very hard to fix and took ages to run. As far as I can see, if you have good unit tests, then the only real benefit is verifying that the IoC container is configured correctly and the config is passed through correctly. All of these things will get picked up by minimal manual or automated UI tests anyway.
The time they take to execute is a bit of an issue for. I like to do TDD and like to run all tests after most changes. This isn't practical with Integration tests as they take too long to execute, so I then need to find the test(s) I want to execute and choose those instead of just using a keyboard shortcut. Does anybody know a good way of separating them?
Does anybody know a better place for doing these kind of tests ie. no in MSTest or NUnit?
|
|
|
|
|
|
I am navigating Excel sheet in WebBrowser control.
eBrowser.Navigate("D:\test.xlsx", false);
if I am updating something in excel sheet which is displayed in WB control then I want to save that changes back to location or wants to import sheet with changes in data table.
I tried to get WB control document on Navigated and DocumentComplete event but always getting wb.Document as null.
So please help me to save the Excel from WB on button click.
I don't want to use ctrl+s option which we can use to save excel directly.
Regards,
Raj
|
|
|
|
|
|
this is my code
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (connect.State == ConnectionState.Open)
{
connect.Close();
}
connect.Open();
String query = "select * from V_General_Books where FileName= '" + FileNameComboBox.Text + "'";// '" + textBox2.Text + "' and UserName= '" + textBox3.Text + "' ";
cmd = new SqlCommand(query, connect);
dr = cmd.ExecuteReader();
if(dr.Read())
{
string bookid = dr.GetInt32(10).ToString();
BookIDTextBox.Text = bookid;
string generalid = dr.GetInt32(0).ToString();
GeneralIDTextBox.Text = generalid;
string isbn = dr.GetString(12);
ISBNTextBox.Text = isbn;
string author = dr.GetString(11);
AuthorNameTextBox.Text = author;
string genre = dr.GetString(16);
GenreTextBox.Text = genre;
byte[] x = (byte[])dr[8];
MemoryStream ms = new MemoryStream(x);
pictureBox1.Image = Image.FromStream(ms);
string series = dr.GetString(15);
SeriesTextBox.Text = series;
string year = dr.GetString(14);
YearOfPublicationTextBox.Text = year;
string dateacquired = dr.GetString(9);
DateAcquiredTextBox.Text = dateacquired;
string filename = dr.GetString(1);
FileNameTextBox.Text = filename;
string filepath = dr.GetString(2);
FilePathTextBox.Text = filepath;
string length = dr.GetString(5);
MediaLengthTextBox.Text = length;
string type = dr.GetString(6);
MediaTypeTextBox.Text = type;
string subtype = dr.GetString(7);
MediaSubTypeTextBox.Text = subtype;
DateTime dateadded = dr.GetDateTime(4);
DateAddedDateTimePicker.MaxDate = dateadded;
string filesize = dr.GetString(3);
FileSizeTextBox.Text = filesize;
string description = dr.GetString(13);
DescriptionRichTextBox.Text = description;
string title = dr.GetString(17);
TitleTextBox.Text = title;
}
connect.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
Check SQL query in SQL server query wizard. The problem is with the SQL query. Whatever the query you written is not fetching any data from database. That is the reason why it's saying no data available.
Cheers,
Purna Chandra Rao.Ch
|
|
|
|
|
Firstly, you should not use string concatenation in your query string. Read http://bobby-tables.com/about.html[^], and use proper parameterised queries. Secondly, you need to check the result of FileNameComboBox.Text , and indeed, the remainder of that statement to verify that you have actiually created a valid query.
Veni, vidi, abiit domum
|
|
|
|
|
Well, which statement occur that error? If you don't know where it is, debug it and get exactly error statement.
And before rerun it, you have to check your sql express again.
|
|
|
|
|
Hi
This is Chandrakanth.
My Query is, I have already Visual Studio 2010 professional in my system.Now i have installed Asp.net MVC4 in my Computer. That system is running with Microsoft XP Professional 2002 with Service Pack3. I was trying to open MVC4 application with Rajor engine from visual studio 2010 but it is giving error.
It says "Visaul Studio encountered problem and needs to close"
Can any one suggest me to work MVC4 Properly.
Thanks
Chandra
Chandrakanth
|
|
|
|
|
Is anything showing up in your event logs?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
ChandrakanthGaddam wrote: I was trying to open MVC4 application with Rajor engine from visual studio 2010 but it is giving error. Does it also happen if you create a new project from a blank template?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Try a reinstall. It could help.
|
|
|
|
|
Hi Thanks
for Your suggestion. I have re installed MVC4. It works now.
Thanks for your suggestions.
|
|
|
|
|
|
Below is my stored procedure
ALTER PROCEDURE [dbo].[sp_Workflow]
@TicketID int output,
@StaffID int output,
@Department nvarchar (50),
@FirstName nvarchar (50),
@TicketStatusID int output,
@TicketStatus nvarchar (50),
@TicketPriorityID int output,
@TicketPriority nvarchar (50)
AS
BEGIN
UPDATE dbo.Staff
SET
FirstName = @FirstName,
Department = @Department
WHERE StaffID= @StaffID
UPDATE dbo.TicketStatus
SET
TicketStatus = @TicketStatus
WHERE TicketStatusID =@TicketStatusID
UPDATE dbo.TicketPriority
SET
TicketPriority = @TicketPriority
WHERE TicketPriorityID =@TicketPriorityID
END
T his is my code
private void Updatebutton_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd = new SqlCommand("sp_Workflow", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@TicketID", System.Data.SqlDbType.Int).Value = TicketIDcomboBox.ToString();
cmd.Parameters.Add("@Department", System.Data.SqlDbType.NVarChar, 50).Value = MoveToDepartmentcomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@FirstName", System.Data.SqlDbType.NVarChar, 50).Value = StaffcomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@TicketStatus", System.Data.SqlDbType.NVarChar, 50).Value = ChangeTicketStatuscomboBox.SelectedValue.ToString();
cmd.Parameters.Add("@TicketPriorty", System.Data.SqlDbType.NVarChar, 50).Value = ChangeTicketPrioritycomboBox.SelectedValue.ToString();
MessageBox.Show("Are you sure you want to update?");
cmd.ExecuteNonQuery();
MessageBox.Show("Ticket Updated");
con.Close();
}
}
|
|
|
|
|
The trick to solving an issue like this is to put a breakpoint in the start of your code and step through it, inspecting the values of various variables to see what they contain. For instance, looking at your code, it strikes me that the problem might possibly be with the line con.Open(); . What if con is null? Where are you allocating it? BTW - you are showing a messagebox and then doing nothing with the result to prevent the query being executed. If I were you, I would move this to the top of the method and only proceed if the user clicks Yes.
|
|
|
|
|
The first step is to figure out where the null reference error is happening.
Why not put a break-point at the entry to the Updatebutton_Click EventHandler code, and single-step through the code until you find the error.
If you call the 'ToString method on a ComboBox's SelectedValue when there is no value selected, you will get a null reference error: that's one of the possible sources of error to evaluate.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
Try debugging your code when this type of error occurs. This generally happens when you access a property or method of an object that itself is null.
|
|
|
|
|
How can i detect an xbee if its connected to computer or not via USB ? and get notification if its connected or not
|
|
|
|
|
I usually first listen to the sound of the computer and verify there is a humming.
Then I place a tea-spoonful of honey in an open dish near the computer and listen to see if there is a change in the pitch of the humming.
If that doesn't work, I use Google to locate two CodeProject articles in the top three search results returned by: [^], and start writing code while trying not to think of dead bees.
good luck, Bill
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
BillWoodruff wrote: start writing code while trying not to think of dead bees For the pure Monty Python that put in my mind, I award you the Order of Pete - it's a shiny badge of honour that you should wear with pride. To get your copy, simply print our your reputation page and look for the points that corresponds to the 5 and cut it out. Wear it with pride my friend.
|
|
|
|