Mark this thread as solved if your question is answered.
Mark this thread as solved if your question is answered.
There are some third party code generation tools for asp.net 2.0 in the market. But most of them are develped as a desktop application which will generate asp.net code with layered approach.
Check these links:
http://www.radsoftware.com.au/codegenerator/
http://www.hkvstore.com/aspnetmaker/
http://www.codesmithtools.com/
Hi i am assigning binary value from sqltable to byte array
The error i am getting is
Cannot implicitly convert type 'System.Data.DataColumn' to 'byte
You are saying that you assign binary value from sqltable to byte array.
But ds.Tables["Photo_Det"].Columns["Photos"] will return an object of type 'DataColumn' and your are trying to convert it into array of unsigned integers (byte).
This is absolutely wrong.
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.hiddenCurrentUser.Value = Request.LogonUserIdentity.Name;
Label1.Text = User.Identity.Name.Replace("DOMAIN\\", ""); ;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (this.hiddenCurrentUser.Value != Request.LogonUserIdentity.Name)
{
Response.Redirect("Default.aspx");
}
else
{
Response.StatusCode = 401;
Response.StatusDescription = "Unauthorized";
Response.End();
}
}
Use the following HTML code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>Hello <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></p>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Sign in as Different user</asp:LinkButton>
<asp:HiddenField ID="hiddenCurrentUser" runat="server" />
</form>
</body>
</html>
Reference:
http://forums.asp.net/t/1309377.aspx
http://forums.asp.net/p/1279595/2441063.aspx
You are referring a local file system in web application. It is not adviceable.
Copy your image file to your asp.net web site folder and refer like
Image1.ImageUrl= "4014_thumb.jpg"; //if you have the file in the root folder
Image1.ImageUrl= "/images/4014_thumb.jpg"; //if you have the file in the sub folder(within 'images' folder)
First you need to check whether the value returned by 'date_search' does not contain blank value by putting break point.
Also the datetime parsing in C# is based on the local date time settings. Therefore if your local date format is dd/mm/yyyy and if you enter date in mm/dd/yyyy format then this error will be happened.
Try this sample code
string connectionString = "Database=YourDatabaseName;Server=YourServername;User Id=YourUserId;Password=YourPassword";
string songUrlName = string.Empty;
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
string queryString = "SELECT Song_URL FROM SONG WHERE Song_Id = 100";//Set correct song id
SqlCommand command = new SqlCommand(queryString, connection);
SqlDataReader reader = command.ExecuteReader();
if(reader.Read())
{
songUrlName = reader["Song_URL"].ToString();
}
reader.Close();
}
In the above, I assumed that you have stored song urls in SONG table. Also change connection string accordingly.
To play song in your web site, you can use <embed > HTML element.
Visit the following links:
http://www.tek-tips.com/faqs.cfm?fid=353
http://googlesystem.blogspot.com/2006/07/embed-mp3-files-into-your-website.html
Why don't you post some code?
Is there any error message displayed?
The keypress event is client side(javascript) event. You cannot handle it in C#.
But if you want to execute some server side code in keypress event, then handle the client side keypress event and call a web service in it.
I have given a solution in your previous thread.
Have you tried that?
Also post come code so that some one can give you a solution.
i've created a stored procedure to display a gridview. but in my DDL i only want to display the whole column instead of the whole row. can anyone help me?
Need more inputs to understand your requirement.
If you want to display specific fields from the records returned by the stored procedure, then you create bound columns only for those fields in GridView. Also make sure you set AutoGenerateColumns property to false in GridView.
Are you referring the textbox in the calendar popup?
If you add master page and content place hodler controls, the name of the textbox will be rendered like ctl00_ContentPlaceHolder1_txtYourTextBoxName..
Therefore see the correct name in the view source and put it in your calendar popup code.
I assume that you opened a popup window from a parent page. If you want to close the poup window, use window.close or self.close javascript functions.
When you run the default.aspx from VS, actually the page is running in a built-in web server of VS 2005/2008 called cassini wev server so that you are able to view in IE.
But if you try to open the .aspx directy from IE through Windows Explorer, the .aspx file will be treated as an xml file and IE will try to parse it.
You can view the .aspx pages from your PC or other PC from network only after deploy your application in IIS.
A simple way to deploy your asp.net application in IIS in Windows XP is right click on the folder in Windows Explorer->Properties->Web Sharing->Share this folder->Enter Alias Name->Press Ok.
.NET Framework: An integral Windows component that supports building, deploying, and running the next generation of applications and Web services.
Metadata: Information that describes every element managed by the common language runtime: an assembly, loadable file, type, method, and so on.
Manifest: An integral part of every assembly that renders the assembly self-describing. The assembly manifest contains the assembly's metadata.
Interoperability : Tools and techniques to interoperate between .NET managed code and unmanaged code include Platform Invoke services and .NET Framework and COM interoperability tools.
Abstract: Abstract classes act as expressions of general concepts from which more specific classes can be derived. You cannot create an object of an abstract class type; however, you can use pointers and references to abstract class types.
You can use RegularExpressionValidator for accepting only four digits and RequiredFieldValidator for mandatory checking.
Hope this sample code will help you.
<asp:TextBox ID="txtPostCode" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="regExpPostCode" runat="server" ControlToValidate="txtPostCode" ErrorMessage="Must be at least 4 digits" ValidationExpression="\d{4}">
</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqFieldPostCode" runat="server" ControlToValidate="txtPostCode" ErrorMessage="Post Code must be entered">
</asp:RequiredFieldValidator>
Are you uploading your web site to a shared server?
It seems that the server admin have set IIS/Asp.Net to disable the ability at the individual websites level to change this setting.
You better contact your server administrator to enable this setting at your site level.
Mark this thread as solved if your question is answered.
Which version of Subtext you are using?
Why don't you use latest version of Subtext (1.9).
Check this link:
Are you using UpdatePanel in your page? If yes, check the solution( see in the bottom) given in this thread.
Also check whether you are binding crystal report in each postback in page_load event. Try to call inital page load like below
if (!Page.IsPostBack)
{
LoadCrystalReport();
}
If the title is consistent across all pages in your web site, you can do it with two ways.
1. Create an UserControl, add a label or a literal control to it to display title text and use it in your pages. Even you can change the title description for each page if the title is not consistent.
2. Create a master page and add a label or a literal control. Then You can then create individual content pages that contain the content you want to display. Master pages allow you to create a consistent layout for the pages in your web application.
As all radio buttons have the same name 'Premium', Request.Params["Premium"].ToString() will return the value of the radio button selected.
For example,
TextBox1.Text = Request.Params["Premium"].ToString();
Use check constraints. A check constraint allows you to specify a condition on each row in a table.
Try this
CREATE TABLE YourTableName
(
column 1...,
column2...,
STATUS numeric(1),
CONSTRAINT check_status
CHECK (STATUS IN (1,2,3))
);
You can have both XAMPP and VS & SQL Server in the same machine.
By default, IIS using port 80. Apache will also try to use port 80 when you install it.
To overcome this problem, Stop iis before the installation of apache.
You can assign port 80 to either apache or IIS.
To change apache's default port, goto httpd.conf in conf directory of installtion. Open it with editor and change
listen 80 to listen 8080 (or whatever port you wish)
servername -> localhost:8080. Save and restart apache server.
To change the default port number of IIS, Start->Run->Type inetmgr->Select Computer Name->Web Sites->Right click on Default Web Site>Properties
It will show Default Web Site Properties dialog box.
Under the Web Site tab->Change TCP Port to 8080 or something whatever you want.
Your Page_Load does not have proper sytax. Change it as below
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x
If Not Page.IsPostBack Then
lbl1.Text = "FIRST TIME LOAD The date and time is " & Now()
' Else
' lbl1.Text = "PAGE IS NOT FIRST TIME The date and time is " & Now()
End If
lbl3.Text = Page.IsPostBack
End Sub
1. Set the button's CommandName property to a string that identifies its function, such as "Insert" or "copy".
2. Create a method for the ItemCommand event of the control. In the method, do the following:
a. Check the CommandName property of the event-argument object to see what string was passed.
b. Perform the appropriate logic for the button that the user clicked.
private void DataGrid_ItemCommand(object source,
DataGridCommandEventArgs e)
{
if (e.CommandName == "AddToCart")
{
// Add code here to insert details into database.
// Use the value of e.Item.ItemIndex to find the data row
// in the data source.
}
}
In your web.config file, add the following settings.
<location allowOverride="false">
<system.web>
<trust level="Full" originUrl="" />
</system.web>
</location>
Using ASP.NET Ajax, you can do partial rendering of your pages.
Use ScriptManage and UpdatePanel controls.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPage20.aspx.cs" Inherits="TestPage20" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
Add your controls here
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Are you using older version of MS Access?
If yes, check this link: http://support.microsoft.com/default.aspx?scid=kb;EN-US;283881
Use InputAttributes instead of Attributes with CheckBox control.
protected void Page_Load(object sender, EventArgs e)
{
CheckBox1.InputAttributes.Add("onchange", "return CheckboxState()");
}
Also use innerText to assign value to label control instead of value property.
<script language ="javascript" type ="text/javascript"> function CheckboxState() {
var checkbox = document.getElementById("CheckBox1");
var lbl = document.getElementById("Label1");
alert(checkbox.checked);
lbl.innerText = checkbox.checked;
return false;
}
</script>
Please note that the onchange will fire only if you move focus to other control from checkbox.
The reason for the error cannot be identified based on the error message. Set the 'mode' attribute of customErrors tag to off. It will display some detailed error message. Post that message to identify the issue.
You need to use session to store the starting time of the Exam. Also you need to use javascript timer(may be ajax), store the starting time in a javascirpt variable and then check whether the exam time is elapsed at client side. You may need to check the elapsed time at server side whenever the user post back to the server.
Validations in the Validtion controls are executed at both server side and client side. They are injecting client side validations to the HTML content if javascript is enabled at client browser. If javascript is disabled at client browser, the javascript validations are not executed but the validation will always be executed at server side.
Check this URL for free web hosting.
To learn about hosting an asp.net web site, visit this link: http://www.asp.net/learn/hosting/
Using a for loop iterate the GridView.Rows collection to see whether the Checkbox is checked. If it is checked, then retrive the data and insert/update into another table.
foreach(GridViewRow gridRow in GridView1.Rows)
{
CheckBox chkBox1 = gridRow .FindControl("yourCheckBoxId");
if(chkBox1.Checked)
{
//Write code to retrieve the values from GridView row using gridRow.Cells collection and insert/Update into another table
}
}
}
OnCheckedChanged is a server side event. You are calling a javascript function for a server side event whichi is wrong.
Use onchange event which is a client side event.
Change your code as below
protected void Page_Load(object sender, EventArgs e)
{
CheckBox1.Attributes.Add("onchange", "javascript: return CheckboxState()");
}
Check this link: http://apps.cybersource.com/library/documentation/dev_guides/Microsoft_Site_Server/html/ch02.html
which provide details about subscription to test CyberSource services with your eCommerce applications and to send transactions to a test server.
TreeView is a server control, It should be enclosed within <form> tag. Also since you are using Master page, it will have a form tag so that you don't need to use a form tag in child pages where the master page is used.
Mark this thread as Solved if your question is answered.
Yes. you need to add the following namespace
using iTextSharp.text.html;
Post your error message so that it will help to identify the issue.
System.Timers.Timer and System.Threading.Timer cannot be used to use a time at client browser. They are intended to use in Desktop application or server side code. Also the System.Web.UI.Time does not have a Start() method.
It is sufficient that if you set the Interval property and handle the Tick event in your page. Also you need to use a ScriptManeger in order to function the Time control well.
Hi Ana,
Ignore my last post. Sorry, I didn't refresh to see your last post.
Put a break point in this event and check the execution control goes inside dTable.Rows.Count > 0 condition.
In the <EditItemTemplate>, use textboxes only for those field that you want to edit. Use Label for non-editable fields.