Hi,
Please provide more details about your requirements/issues in asp.net mvc.
Also refer the following links if helpful.
Treatment of spaces-only input in ASP.NET MVC
http://stackoverflow.com/questions/4282572/asp-net-mvc-razor-extra-space
Hi,
Please provide more details about your requirements/issues in asp.net mvc.
Also refer the following links if helpful.
Treatment of spaces-only input in ASP.NET MVC
http://stackoverflow.com/questions/4282572/asp-net-mvc-razor-extra-space
Hi,
Put a breakpoint and step into the class in Visual Studio and try to find which line throws the error. Also check the field names enclosed in double quotes between lines 16 and 22 in your code.
Hi,
I Would suggest to use Entity Framework as it has many new features over ADO.NET.
Hi,
If you just want to show different light color based on the information logged into database by the device, you can just try to use <img> html tag with images for each color. Try the following steps:
Display an image in <img> tag in an asp.net page. Have images for each color based on the device information.
Since the information is continously updated in the database by the device, Write a method to get the latest information via web service in asp.net.
Check the following links to know more about calling web services from javascript asynchronously using asp.net ajax.
http://www.asp.net/ajax/documentation/live/Overview/AsynchronousLayerOverview.aspx
http://msdn.microsoft.com/en-US/library/bb515101.aspx
If you want to dislay a more dynamic chart graph, you can try to use ASP.NET chart control. Refer the following links.
http://www.microsoft.com/en-us/download/details.aspx?id=22000
http://archive.msdn.microsoft.com/mschart
The error could be occured in the following line.
Dim gender As Integer = Convert.ToInt32(e.Row.Cells(5).Text*)
Put a breakpoint and see if the value of e.Row.Cells(5).Text is a number or empty string. It seems the index of the data cells(GridView column) may not be 5 or returns a non numeric value for some rows.
Hi,
Does this error occur in IIS or Visual Studio? If IIS, which version are you using? or are you opening a web site from IIS in Visual Studio? Please provide more details.
This will happen if you run the web application from IIS and the application pool is set to 2.0 but attribute of targetFramework is set to 4.0 in web.config. In this case, you need to change the application pool to Framework 4.0.
Hi,
Check if the web.config file has references to both 10.0.0.0 and 9.0.0.0 versions of ReportViewer control. If it contains, remove the unwanted version details and try again.
Create a new website/web application, add reference to the appropriate version of ReportViewer control and take a look at the entries that are created in the web.config. Update the same in the web.config of your existing web application.
Hi,
You can try to use GridView to display records in tabular format and on clicking a link in the GridView, Use a FormView to display the details of the row clicked.
Please look at the following links.
GridView-FormView (Master/Detail) Control
Working with the GridView and FormView
Hi,
Set the defaultbutton property in the <form> tag to the ID of button that should get fired when user press enter key to submit the form.
For example,
<form id="form1" runat="server" defaultbutton="btnLogin">
Hi,
Hope the solution given in the following link will help you.
AsyncFileUpload postback causes double upload
Someone has reported the same issue in CodePlex site here. But it is closed as the issue cannot be reproduced.
Hi,
If you are using third party components such as CuteChat they will offer the API to maintain and display the list of users entered the chat room.
If you build your own chat application, you need to maintain the user list in Session or Database or XML file.
Check the following link.
Hi,
Please refer the following link.
GridView with an AJAX rating control, DropDownLists, JavaScript to enable/disable rows - an exercise
Also 'Urgent' is not a meaningful title for a thread. Please keep the thread title brief and descriptive.
Hi,
Declare the Connection object myConn before the try clause and initialize it within the try.
I suggest to change your code as follows:
protected void Names()
{
OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=e:\\project\\Db.mdb");
OleDbDataReader myReader = null;
string strQuery = "SELECT TOP 1 Name FROM Names";
try
{
myConn.Open();
OleDbCommand myComm = new OleDbCommand(strQuery, myConn);
myReader = myComm.ExecuteReader();
if (myReader.HasRows)
{
myReader.Read();
Session.Add("Name", myReader[0].ToString());
myReader.Close();
//reuse the myConn connection
strQuery = "SELECT bla bla bla WHERE bla bla bla";
OleDbCommand myComm2 = new OleDbCommand(strQuery, myConn);
myReader = myComm2.ExecuteReader();
}
}
catch (Exception er)
{
Response.Write("Error:" + er.Message);
}
finally
{
if (myReader != null)
{
myReader.Dispose();
}
if (myConn != null)
{
myConn.Close();
myConn.Dispose();
}
}
}
Hi,
1. On page load, Fill a DataTable with records retrieved from Database.
2. Store the DataTable in Session. Also bind the DataTable to the GridView.
3. In the Edit/Update events, Get the DatatTable from Session, Update/Edit the appropriate record in the DataTable, Store it in Session again, Re-bind the DataTable to GridView.
You can finally update the DataTable with database. After saving, clear the session variable which is used for storing it.
It is not advisable to store a large DataTable in Session.
Hi,
Perform the following steps and try again.
1. Login to the system using local administrator account.
2. Add your site to the 'Trusted sites' list. IE->Tools menu->Internet Options->Security tab.
3. Enable UAC at the default level.
4. Reboot if required.
Hi,
I don't think that the issue occurs due to the server setup and hosting. Because you are saying that the chain commission calculation is skipped only for few cases.
The code may not be handling all the scenarios to perform the calculation.
Where do you handle the calculation? In the server side (C#) or database side through stored procedure?
If the logic is written in C#, It would be better to handle the calculation in the stored procedure.
Also ensure that exception handling is done well and error message are logged/displayed properly in the code.
You can try to log some messages into a text file/database table in each stage of calculation so that you could identify whether which portion of code is not reached.
Hi,
Take a look at the following links.
Creating Contact Us Form easily using ASP.NET and SMTP
Hi,
You are creating the <tr> within the for loop. Thus it creating multiple table rows.
Try to put it before the for loops.
Hi,
No web.config is found in the sample project downloaded from the above link.
You need to add a web.config and add connection string as below:
<connectionStrings>
<add name="NorthwindConnectionString" connectionString="Data Source=serverName;Initial Catalog=Northwind;User ID=userName;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
You need to specify the correct server name, database, user id and password etc in the connection string.
Hi,
qTip is an advanced tooltip plugin using jQuery.
You can also try the following:
ASP.Net AJAX TooltipExtender
jQuery Ajax Tooltip
Hi,
You can try to use SqlBulkCopy Class in .NET.
SqlBulkCopy.WriteToServer Method (DataTable)
The above method copies all rows in the supplied DataTable to a destination table specified by the DestinationTableName property of the SqlBulkCopy object.
Also refer the following links.
Transferring Data Using SqlBulkCopy Class
Bulk Insert into SQL from C# App
Hi,
You can try to use the target="" attribute on the <form /> tag to post data to the IFRAME as follows:
<form id="Form1" runat="server" method="post" target="iframe1">
...
...
...
<iframe name="iframe1" style="width: 744px; height: 333px; margin-top: 16px; margin-bottom:0px;" >
Also please refer the discussion in the following threads:
How do you post to an Iframe?
JavaScript post request like a form submit
Hi,
What do you mean by msgbox control?. There is no msgbox control in asp.net. There is aMessageBox class available in C# which displays a message box that can only be used with Windows Forms applications. It cannot be used with web application.
Please provide more details.
Also if the redirected page reads the content of the text file which is created by the C# exe, you should redirect to that page only after the text file is created by the exe ie., after the execution of the exe is completed. For this, you can useSystem.Diagnostics.Process class to run the c# exe and redirect to the aspx page in the Process.Exited event which occurs when a process exited/completed.
Hi,
Removing the space in the URL works for me in IE7 but not in Firefox 4.0.
You are using the name of the IFRAME in the getElementById() function. You need to use the ID of the IFRAME instead of name. Hence changing the following statement works for me in both IE7 and Firefox4.0.
function loadIframe() {
document.getElementById("iframecredit").src = "https://www.vcs.co.za/vvonline/ccform.asp";
return false;
}
Here 'iframecredit' is given as ID of the IFRAME in your first post.
Hi,
The connection string for MySQL in ASP.NET is as follows:
Server=localhost;Port=3309;Database=Test;Uid=username;Pwd=password;
Refer the following link.
Hi,
Since you are trying to set the url "https: //www.vcs.co.za/vvonline/ccform.asp" which is not in the same domain, The iframe may not be refreshed due to browser security reasons. If you set the url from the current domain, it will work. Otherwise you need to set the url from code behind(.cs) as it executed from a full postback.
Hi,
If you want to bypass the loading of IFRAME in page load and re-load the url (src property of IFRAME) later, then set src property to empty string("") in the HTML markup (.aspx page). You can set the url in your .cs code as follows.
protected void Button1_Click(object sender, EventArgs e)
{
iframecredit.Attributes.Add("src", "https://www.vcs.co.za/vvonline/ccform.asp");
}
Hi,
It could be caused due to any number of reasons. Check the following:
1. Ensure that the web service is not blocked by the anti virus installed in your PC/Network.
2. Pass credentials to access the web service if required. Refer the following links.
HOW TO: Pass Current Credentials to an ASP.NET Web Service
A connection attempt failed because the connected
Hi,
Hope the following links will help you.
How do I use .htaccess to redirect an aspx page to a php page?
Redirect any page that has an .aspx ending to a new url.
Hi,
You cannot retain value in FileUpload control due to security reasons. Also you cannot save the file entered manually in the FileUpload control. You can upload the file only if the file is browsed and selected by clicking the 'Browse' button.
Please refer the following link.
Hi,
Glad to hear that you found a solution. Please mark this thread as solved.
Hi,
Since the form's border is drawn by the OS, It is difficult to change and also not advisable.
You can try to use the CodePlex Project for Drawing Custom Borders.It is a small library that extends Windows Forms with ability to customize the windows's non-client area.
You can also try the solution given in the following MSDN Forum thread.
Hi,
Check the following link.
Programmatically updating one update panel elements from another update panel elements
Hi,
To analyze the problem, It would be better if you post the method/complete code snippet where this error occurs. Because this error could be occurred due to issue in the other lines of code. Please provide the VS and asp.net project version details.
Also refer following links.
http://msdn.microsoft.com/en-us/library/8dy0ah20%28v=vs.80%29.aspx
http://stackoverflow.com/questions/3764476/vb-net-linq-to-datatable-error-end-of-statement-expected
http://www.dreamincode.net/forums/topic/195427-end-of-statement-error/
Hi,
Check if the following link will help you to sort out the issue.
Hi,
Do you mean that the FileUpload control is working properly in other pages where UpdatePanel control is used?
Hi,
The FileUpload control is not not compatible with UpdatePanel control. Please read section 'Controls that Are Not Compatible with UpdatePanel Controls' in the following MSDN link.
Alternatively, You can try to use the following solutions:
swfupload - It is a third party component which uses javascript and flash. It is free and open source.
Hi,
Take a look at the following links.
HOW TO: Call SQL Server Stored Procedures in ASP.NET by Using Visual C# .NET
CodeSnip: Calling a Stored Procedure from ASP.NET 2.0
Hi,
When you run the website admin tool, it will refer the membership provider connection string from machine.config file if your local web site does not have that information.
By default, the membership provider connection string in the machine.config may refer to the SQL Express instance(refer LocalSqlServer) and aspnetdb.mdf database file.
Hence when you try to run the Website Admin Tool from your site, it tries to connect to the SQL Express database. If the SQL Express instance or database is not found, it may return the timeout error. To avoid this, provide connection string details for the membership provider in your local web site.
Hi,
Change Response.BinaryWrit() as follows and try it.
Response.BinaryWrite(DirectCast(myDataReader.Item("IMAGECONTENT"), Byte()))
or
Response.BinaryWrite(CType(MyDataReader.Item("IMAGECONTENT"), Byte()))
Hi,
Try the following code.
Dim resultRows() As DataRow
resultRows = GetContentSet.Tables("Batteries").Select("WithoutHypons = '" & val & "'")
If resultRows.Count() >0 Then
Public GetMB As DataRow = resultRows(0)
If GetMB("id") = Nothing Then
lblStatus.Visible = True
Else
Response.Redirect(String.Format("/MBProduct.aspx?ref={0}", GetMB("id")))
Page.DataBind()
End If
End If
Hi,
Put a break point in the method, step into each line of code and see which line is throwing the error. For example, the following line could cause the problem.
GetMB = GetContentSet.Tables("Batteries").Select("part = '" & val & "'")(0)
The DataTable.Select(string) method will return the array of DataRows that match the filter criteria. If the condition fails, it will return empty array. But you are trying to get the first row using the Select("part = '" & val & "'")(0) part without checking whether the Select condition returns an array of datarows.
Hi,
The machine.config file can be located in the following folder in the server/PC.
drive:\<windows>\Microsoft.NET\Framework\<version>\config\machine.config
You can open it using notepad or VS 2005.
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/management/mgmtapi.aspx
Hi Kiran,
Ignore my previous post. I though you assigned the GridView.SelectedIndex to GridView.PageIndex. I didn't see detailview1.PageIndex properly.
Sorry for the inconvenience. Please follow the adatapost reply.
Hi,
GridView.SelectedIndexChanged Event occurs when a row's Select button is clicked, but after the GridView control handles the select operation. GridView.SelectedIndex property returns the zero-based index of the selected row in a GridView control. You are trying to assign the row index to the PageIndex property which is completely wrong.
Hi,
Just check the control's ID found in the JavaScript and ID tag of the image control in the HTML source. You can do it by Right click->View Source.
The HttpApplication.AcquireRequestState event occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request.
Since you used to redirect to timeouterror page in the Application_AcquireRequestState event, first time it redirects to timeouterror page.
Why do you redirect to timeouterror page in Application_AcquireRequestState event?
Hi,
The index.aspx is set as the default document to your web site. You can change or remove it in IIS 6.0 using the following steps:
1. Open the IIS ( Start->inetmgr)
2. In the IIS, Expand Server Name->Web Sites->Right click on your site->Select Properties menu
3. In the Properties dialog box, Click on the Documents tab
4. In the List box Under the 'Enable default content page' checkbox, you can add new content page (.aspx page) or change the order of the existing default pages using Move Up and Move Down buttons. Based on this settings, your site will display the default page when the url is typed.
Also refer this link: Setting Up Default Documents (IIS 6.0)