|
I'm stuck on a situation to change html element sytle in a webbrowser2 in a mfc dialog program. VC6+windows sdk 2003.
Does anyone have idea how to do it?
i already got the onclick event and get the ihtmlelement object. really emergence, pls help me if you can, thx first.
|
|
|
|
|
I m facing prob when i try to update datagrid.I click the edit button and write data in textboxes but i still get old data which i got from my database.Plz help me!!!!
-- modified at 17:30 Saturday 27th May, 2006
|
|
|
|
|
Hi
put your code here(update code) for error handling
|
|
|
|
|
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
using System.Globalization;
namespace WebApplication4
{
///
/// Summary description for properties.
///
public class properties : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Image Image1;
public DataView dv;
public SqlConnection conn;
public SqlDataAdapter da=new SqlDataAdapter();
public DataSet ds=new DataSet();
public void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Label1.Text=User.Identity.Name;
string strConnection =" Integrated Security=SSPI;";
strConnection += "initial catalog=dbREO;server=DCSIAN;";
strConnection += "Connect Timeout=30";
conn = new SqlConnection (strConnection);
conn.Open ();
da=new SqlDataAdapter("SELECT * FROM tblCommercialProperty WHERE ID= '" + Label1.Text+ "' " ,conn);
da.Fill(ds,"tblCommercialProperty");
DataGrid1.DataSource=ds.Tables["tblCommercialProperty"];
DataGrid1.DataBind();
}
public void DataGrid1_SelectedIndexChanged(object sender,System.EventArgs e)
{
DataGridItem dgi = ((DataGrid)sender).SelectedItem;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.DataGrid1.CancelCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_CancelCommand);
this.DataGrid1.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_EditCommand);
this.DataGrid1.SortCommand += new System.Web.UI.WebControls.DataGridSortCommandEventHandler(this.DataGrid1_SortCommand);
this.DataGrid1.UpdateCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_UpdateCommand);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex=e.Item.ItemIndex;
DataGrid1.DataBind();
}
public void DataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex=-1;
DataGrid1.DataBind();
}
public void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataTable dt=new DataTable();
DataRow dr;
dt=ds.Tables["tblCommercialProperty"];
dr=dt.Rows[0];
//I m not using (TextBox)e.item.FindControl because my sql query gives me the single row which have ID=Label1
//The problem is that these cells write actual values in database,i want edited values
//Updation is working correctly because when i move one column's value into another it updates that
dr["CoveredArea"]=((TextBox)e.Item.Cells[3].Controls[0]).Text;
dr["Location"]=((TextBox)e.Item.Cells[4].Controls[0]).Text;
dr["Area"]=((TextBox)e.Item.Cells[5].Controls[0]).Text;
dr["OtherDetails"]=((TextBox)e.Item.Cells[6].Controls[0]).Text;
dr["Status"]=((TextBox)e.Item.Cells[8].Controls[0]).Text;
SqlCommandBuilder cmd=new SqlCommandBuilder(da);
da.Update(ds,"tblCommercialProperty");
DataGrid1.DataSource=ds.Tables["tblCommercialProperty"];
DataGrid1.EditItemIndex=-1;
DataGrid1.DataBind();
}
public void DataGrid1_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
dv.Sort=e.SortExpression;
DataGrid1.DataBind();
}
}
}
|
|
|
|
|
Hi,
Bind you datagrid in pastback at the page load time
e.g
Page_load()
if not ispostback then
bindDatagrid()
end if
end sub
Sincerely,
Vineet Kaushik
Sr. Web Developer
|
|
|
|
|
|
I want to prevent users from entering an existing code in my database.
I have a middle tier that checks and return whether a Code exists or not.
Which validation control do i need to tell user that the code they
entered is already existing
t.aransiola
|
|
|
|
|
Use the CustomValidator control. Then you need to write code for its ServerValidate event
You write something like
ars.IsValid = IsValidCode(args.Value)
where IsValidCode() is a function for you to implement, which it looks like you already have from your middle tier.
Then in your Submit or OK button click event
If Page.IsValid Then
...
End If
Kevin
|
|
|
|
|
i dont know if i can do that but im looking to send a form by email, now until now at school i got only to html and javascript and i know that its very easy to be done in asp or cgi. so i wanted to see if its possible to send a form by email using javascript because also i use only geocities as i need to finish my html and javascript project and geocities is not really supporting anything from what i know
would appreciate any help
|
|
|
|
|
Set the action property of the form to the email address: action="mailto:the@email.com".
---
b { font-weight: normal; }
|
|
|
|
|
the problem with that is that it will automatically open the defauly mail client i dont want it to happen
|
|
|
|
|
In that case, no, it's not possible.
---
b { font-weight: normal; }
|
|
|
|
|
i am getting xmlhttp.status=0 instead of 200 which means data is ok . please help me out .
<html>
<head>
<script type="text/javascript">
var xmlhttp
function loadXMLDoc(url)
{
// code for Mozilla, etc.
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
xmlhttp.onreadystatechange=state_Change
xmlhttp.open("GET",url,true)
xmlhttp.send(null)
}
// code for IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
xmlhttp.onreadystatechange=state_Change
xmlhttp.open("GET",url,true)
xmlhttp.send()
}
}
}
function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
{
// if "OK"
alert(xmlhttp.status);
if (xmlhttp.status==200)
{
alert("XML data OK")
document.getElementById('A1').innerHTML=xmlhttp.status
document.getElementById('A2').innerHTML=xmlhttp.statusText
document.getElementById('A3').innerHTML=xmlhttp.responseText
}
else
{
alert("Problem retrieving XML data:" + xmlhttp.statusText)
}
}
}
</script>
</head>
<body onload="javscript:loadXMLDoc('menu.xml')">
<h2>Using the HttpRequest Object</h2>
<p><b>status:</b>
<span id="A1"></span>
</p>
<p><b>status text:</b>
<span id="A2"></span>
</p>
<p><b>response:</b>
<br><span id="A3"></span>
</p>
</body>
</html>
my xml file is menu.xml which is
<?xml version="1.0" encoding="UTF-8"?>
<courses>
<topic>
<topicname>Search</topicname>
</topic>
<topic>
<topicname>Lubrication Fundamentals</topicname>
</topic>
</courses>
-- modified at 8:33 Friday 26th May, 2006
|
|
|
|
|
can anyone give me the approach to download a file from a ftp server using multithreding. (i.e. separate threads for downloading simultaneously USING JAVA)
VIVEK
|
|
|
|
|
Hi, I dont use java... but... what you need to do is incorporate your pasv port process inside a thread.. i dont know for sure about the rest.. they may or may not have to be in a thread...
|
|
|
|
|
sorry pasv port is ftp socket.... basically just the socket which connects must be in a thread and possibly even the file write process...
|
|
|
|
|
How Can I assign the js variable to php variable?
Programistebo saqartvelosi sheertdit
|
|
|
|
|
You have to pass a variable to a server side script (PHP) using one of the following methods:
1) GET
2) POST
3) Cookie
HTML FORM's are typically sent using POST (as the amount of data you are allowed to submit is likely virtually infinite) however if you have a variables passed in Javascript, you will likely want to use GET.
var jscript_var = "Some value";<br />
<br />
location.href="index.php?jscript_var="+jscript_var;
YYou could also use cookie or post, but POST would be awkward without AJAX and Cookies are more permanent...
The above code shows you how to pass a variable though
HTH
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Thank you Hockey.
Programistebo saqartvelosi sheertdit
|
|
|
|
|
i want develop login application which consists of name and pwd textboxes.with submit btn
when i enter a name it should be checked with database table.i want to enter unique name and pwd for every user.
and even they should be able to change their pwd
can anyone tell me code for this using asp.net and vb.net
|
|
|
|
|
In .Net 2.0 you have a login control. You may develop a page to change the password.
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
How do I display thumbnail images in multiple rows from images stored in the database? I want to show up to 5 thumbnail images in each row in seperate cells from the database and the header cell to span all 5 cells.
How do I display the enlarged image after clicking on the hyperlink through pop up ?
Thanks,
Arpita
|
|
|
|
|
Shared DLL assembly that will be used by 100's of web apps.
What is the best way to deploy this shared assembly, considering the shared assembly version is not fixed... it is still in ongoing development and may need to be updated once per month with new functionality.
GAC? this would mean regression testing the dependent apps(100's) for each new version.
/bin folder? this would mean multiple versions of the shared assembly in use at any 1 time.
Any other methods?
What deployment method is best?
thanks.
|
|
|
|
|
Hi,
thank you for your attention,here is my problem:
I have write an applet for tv topset, means that the applet must get input focus when applet start,I have tried to call requestFocus() in start() method of applet ,but it's nouse,current situation is that the applet appears when I start it on IE,but I have to click on it to "active" it input focus.
How can I get the applet response to keyboard automatically,'cause the TV topset without mouse
thank you.
-- modified at 7:45 Thursday 25th May, 2006
|
|
|
|
|
Hi,
I am using pure html and opening a word file in the browser.
Whenever i click on the link to open a file it shows a dialog saying if i want to save the file or open it.
Is it possible to supress the dialog and just open the file and viewing the contents in a frame.
I want to open trhe file in browser window only.
I can use javascript also but dont know how, if someone can please provide me with the appropriate code it would b gr8.
Thanks.
Deepak Surana
-- modified at 2:06 Thursday 25th May, 2006
|
|
|
|