Forum: ASP.NET Mar 19th, 2009 |
| Replies: 3 Views: 1,102 Try this:
protected void Button1_Click(object sender, EventArgs e)
{
if(FileUpload1.HasFile)
{
string fileName = FileUpload1.FileName;
string... |
Forum: ASP.NET Mar 16th, 2009 |
| Replies: 2 Views: 427 <table style="text-align:center">
This is to align the content/data inside the table
One way to achieve your requirement is to put your table inside a div and align the div to center. Here is a... |
Forum: ASP.NET Mar 11th, 2009 |
| Replies: 1 Views: 472 Rather than using Response.Write to inject javascript from code behind, you can use the ClientScript.RegisterStartupScript function to achieve this. This may solve your issue. Here is a sample code
... |
Forum: ASP.NET Mar 4th, 2009 |
| Replies: 2 Views: 1,856 Before binding your DataTable(DataSource) to the grid, check the row count of the DataTable. If its empty (row count = 0) then add a dummy row to the DataTable and then bind it with the grid. Also... |
Forum: ASP.NET Feb 26th, 2009 |
| Replies: 2 Views: 891 Here (http://www.leastprivilege.com/AddingErrorMessagesToAValidationSummary.aspx) is an article that explains exactly how to do that. |
Forum: ASP.NET Feb 24th, 2009 |
| Replies: 2 Views: 512 Try this:
if (FileUploadControl1.HasFile)
{
//upload a file
}
else
{
lblResult.Text = "Please select a file first";
} |
Forum: ASP.NET Feb 23rd, 2009 |
| Replies: 4 Views: 1,688 To solve your compilation error issue rewrite line 21 like this:
MonitorChanges(ctrl) |
Forum: ASP.NET Feb 19th, 2009 |
| Replies: 15 Views: 3,815 Select the function name "MsgBox", right click and from the menu select Go to Defenition and post the fuction defenition here. I suppose its a user defined function |
Forum: ASP.NET Feb 19th, 2009 |
| Replies: 15 Views: 3,815 MessageBox is only available in Window Applicaitons. In ASP.NET, you cannot use the MessageBox class or MsgBox function like you can in a Window Applicaitons, but you can emulate this functionality... |
Forum: ASP.NET Feb 19th, 2009 |
| Replies: 2 Views: 1,093 As your error message suggests, you cannot have multiple items selected on a Dropdownlist. You can set only one ListItem's Selected property to true, which will be the default selected Item of your... |
Forum: ASP.NET Feb 17th, 2009 |
| Replies: 9 Views: 4,079 The problem is the by default, the HtmlEncode property of the boundfield attribute is set to True. This helps prevent cross-site scripting attacks and malicious content from being displayed.... |
Forum: ASP.NET Feb 17th, 2009 |
| Replies: 1 Views: 656 Check this code snippet
int rowIndex;
for(rowIndex = 0; rowIndex < myGrdView.Rows.Count; rowIndex++)
{
LinkButton ObjlnkBtn = new LinkButton();
... |
Forum: ASP.NET Feb 17th, 2009 |
| Replies: 3 Views: 559 I dont think there is a built in method to get selected ItemsCollection only. Even if there is one, the algorithm would be the same as yours. So it wont solve the performance issue. One way to do... |
Forum: ASP.NET Feb 17th, 2009 |
| Replies: 4 Views: 632 Rewrite your catch block like this and let me know what message u get on the label
Catch ex As Exception
blnValidUser = "False"
lblError.visible =... |
Forum: ASP.NET Feb 16th, 2009 |
| Replies: 4 Views: 632 What exception/error message you are getting? |
Forum: ASP.NET Feb 9th, 2009 |
| Replies: 3 Views: 928 Try this
Label2.Text = (Label) this.FormView1.FindControl("passwordLabel").Text; |
Forum: ASP.NET Feb 6th, 2009 |
| Replies: 10 Views: 1,317 da.Update(ds, "mytable");
Here "mytable" should be replace by your tablename. I have given it just as an example. Since your Dataset contains only one table you can use this instead.
... |
Forum: ASP.NET Feb 6th, 2009 |
| Replies: 10 Views: 1,317 Try this:
SqlDataAdapter da = new SqlDataAdapter("select * from mytable",strCon);
SqlCommandBuilder m_cd = new SqlCommandBuilder(da);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
... |
Forum: ASP.NET Feb 6th, 2009 |
| Replies: 10 Views: 1,317 Can u post your full code here. |
Forum: ASP.NET Feb 6th, 2009 |
| Replies: 10 Views: 1,317 Try using the SqlCommandBuilder Class like this
SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(mySqlDataAdapter);
mySqlDataAdapter.Update(myDataSet, "myTableName"); |
Forum: ASP.NET Feb 3rd, 2009 |
| Replies: 3 Views: 1,367 Which DB are you using?
On MS Sql Studio Management Express, Right Click on the node "Databases" and Select "Restore Database" option. |
Forum: ASP.NET Feb 2nd, 2009 |
| Replies: 4 Views: 1,027 Try this
//Store an array in to a ViewState
ArrayList arrayVariable = new ArrayList();
ViewState["myArray"] = arrayVariable;
//Retrive array from ViewState
arryVariable = (ArrayList)... |
Forum: ASP.NET Feb 2nd, 2009 |
| Replies: 2 Views: 470 There is no built in method to refresh a control alone in a webpage. Either you have to refresh the whole page in every 10 Sec or U can use AJAX to refresh your control. You can have your interval... |
Forum: ASP.NET Jan 30th, 2009 |
| Replies: 6 Views: 1,337 Can you post the entire button click event here. And when do u get the Item Saved alert, b4 or after confirmation message? |
Forum: ASP.NET Jan 30th, 2009 |
| Replies: 6 Views: 1,337 I cant see anything on this code snippet. May be your custom control MsgBox1 is corrupt. Can u please remove the statement
MsgBox1.alert("ItemSaved");
from the code and replace it with this.
... |
Forum: ASP.NET Jan 30th, 2009 |
| Replies: 6 Views: 1,337 Could you please post your Image button source code in .aspx file.
There might be a javascript function which contains a window.close(); statement that is being called on 'OnClientClick' of the... |
Forum: ASP.NET Jan 30th, 2009 |
| Replies: 2 Views: 440 Captcha Image(image with moving or tilted characters) Verification is a method of preventing automated bots (or Scripts) from gaining aaccess to web page features, tyically submission forms. An... |
Forum: ASP.NET Jan 30th, 2009 |
| Replies: 3 Views: 465 Try this too:
1) Make sure that IIS is configured to use Integrated Windows Authentication. Look for the checkbox on the Authentication Method dialog launched from the Directory Security tab of... |
Forum: ASP.NET Jan 23rd, 2009 |
| Replies: 4 Views: 381 The best method to do this is in your DateBase Table.
Add a primary key ID field of type integer with identity specification set to true. It will increment your ID field on each row insert |
Forum: ASP.NET Jan 22nd, 2009 |
| Replies: 2 Views: 743 This link will help you doing it
... |
Forum: ASP.NET Jan 22nd, 2009 |
| Replies: 1 Views: 400 Try this link, hope it will be helpful
http://www.codeproject.com/KB/IP/EmailByjebarson.aspx |
Forum: ASP.NET Jan 22nd, 2009 |
| Replies: 2 Views: 344 In C#, for selecting a single cell content from a dataset use:
ds.Tables[tableIndex].Rows[rowIndex][columnIndex].ToString();
So ds.Tables(0).Rows(0).item(0) in vb becomes... |
Forum: ASP.NET Jan 21st, 2009 |
| Replies: 3 Views: 3,748 "INSERT INTO desg VALUES(" + txtsno.Text + ", " + txtdesg.Text +", " + txtbasic.Text + ");";
You dont need to worry about Trim and Val functions here. Trim will happen automatically and Val is... |
Forum: ASP.NET Jan 21st, 2009 |
| Replies: 5 Views: 3,769 Remove the if(!Page.IspostBack) form your code which is preventing your dynamic control from recreating during postback. Let the control be created on every subsequent pageload(or postback). |
Forum: ASP.NET Jan 21st, 2009 |
| Replies: 5 Views: 3,769 On page load do this
//Creating Dynamic Image Button
ImageButton objImageButton = new ImageButton();
objImageButton.ID="dynImageButton";
... |
Forum: ASP.NET Jan 21st, 2009 |
| Replies: 1 Views: 396 //First store your file in to a byte array like this
HttpPostedFile filPosted = filUpload.PostedFile;
int intFileLength = System.Convert.ToInt32(filPosted.ContentLength);
byte[] byteData = new... |
Forum: ASP.NET Jan 20th, 2009 |
| Replies: 3 Solved: C# Views: 405 Select the control in design view and from the right click menu select Properties. Now on the properties window click on the events icon on its the top. All valid event will be listed there. Double... |
Forum: ASP.NET Jan 20th, 2009 |
| Replies: 3 Views: 787 Is this what you are looking for
Function getTheData() As DataTable
Dim DS As New DataSet()
Dim strConnect As New SQLConnection ("Server=credentials")
Dim nutType As String
... |
Forum: ASP.NET Jan 19th, 2009 |
| Replies: 2 Views: 1,940 Try this
Response.Write(htmlString ); |
Forum: ASP.NET Jan 19th, 2009 |
| Replies: 3 Views: 2,687 Unfortunately you cannot set a filter for the file browser dialog, but you could add a JavaScript function that would validate the extension of the selected file when a new file is selected. Thus you... |