|
i am sorry sir but i could not find the link.
|
|
|
|
|
thanks sir i have got it.
|
|
|
|
|
hi,
i am opening a web application from a windows applicatino using
SHDocVw.InternetExplorer.
eg.
object vPost, vHeader, vFlags, vTargetFrame, vUrl;
string vPostData;
vPostData = "SecKey=123&Uname=xyz";
SHDocVw.InternetExplorer ie; //Class ie = new SHDocVw.InternetExplorerClass();
vFlags = null;
vTargetFrame = null;
vUrl = "http://localhost/app/StartUpPage.aspx";
vHeader = "Content-Type: application/x-www-form-urlencoded" + Convert.ToChar(10) + Convert.ToChar(13);
//Convert the string to post to an array of bytes.
vPost = ASCIIEncoding.ASCII.GetBytes(vPostData);
ie.Navigate2(ref vUrl, ref vFlags, ref vTargetFrame, ref vPost, ref vHeader);
In the above code vpost is an bytes array which i am posting to the web application.
my question is how to receive the posted data in a web application
Sandeep Kumbhar
|
|
|
|
|
I have a user control on my site (in directory UserControls/UserInfo. When I drop the control onto a page created from my master page template, it does nothing (i.e. you click on the "login" link and nothing happens). I even added an explicit link to a Login.aspx url on the LoginStatus line, which will work. However, the LogOut link does not work.
I've found I can drop this user control onto any new, blank (i.e. not derived from MasterPage.master) and all works as expected.
Also, when I run in debug mode, I get the following error when I click on the Login link:
"Microsoft JScript runtime error: Object doesn't support this property or method"
The method highlighted is: "theForm.submit();"
This call is in the javascript function created to do the postback:
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
The javascript issues I just listed may be a red herring.
I've included the user control code below. Any assistance on why this doesn't work within master pages would be helpful and greatly appreciated.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserInfo.ascx.cs" Inherits="UserControls_UserInfo" %>
<asp:loginview id="LoginView1" runat="server">
<anonymoustemplate>
<rolegroups>
<asp:rolegroup roles="Administrators">
<contenttemplate>
<asp:loginstatus id="LoginStatus2" logoutaction="Redirect" runat="server">
ReelPushMowers
Catalog Admin
Welcome! | You are not logged in.
<asp:loginstatus id="LoginStatus1" runat="server">
| <asp:loginname id="LoginName2" runat="server"
formatstring="Hello, <b>{0}</b>!">
| |
|
|
|
|
|
...make sure that you don't have any other form controls on your page that have ID="submit". This caused the same error on my system whilst converting an HTML layout to ASP.NET because JavaScript was referencing a form element called submit, rather than the submit() method of the form.
|
|
|
|
|
I have Posted this before but didnt get any ans !
When i use this code i get errors
<code> MailMessage msgMail = new MailMessage();
msgMail.To = "info@itfarda.com";
msgMail.From = TxtForm.txt;
msgMail.Cc = "jojoba2010@yahoo.com";
msgMail.Subject = "Contact Us";
msgMail.Body = txtContactUs.txt;
SmtpMail.SmtpServer = "MySMTPSServer";
SmtpMail.Send(msgMail);</code>
Error 1 Property or indexer 'System.Net.Mail.MailMessage.To' cannot be assigned to -- it is read only G:\WebSite3\Default.aspx.cs 24 9 G:\WebSite3\
Error 2 Cannot implicitly convert type 'string' to 'System.Net.Mail.MailAddressCollection' G:\WebSite3\Default.aspx.cs 24 22 G:\WebSite3\
Error 3 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'txt' and no extension method 'txt' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?) G:\WebSite3\Default.aspx.cs 25 32 G:\WebSite3\
Error 4 'System.Net.Mail.MailMessage' does not contain a definition for 'Cc' and no extension method 'Cc' accepting a first argument of type 'System.Net.Mail.MailMessage' could be found (are you missing a using directive or an assembly reference?) G:\WebSite3\Default.aspx.cs 26 17 G:\WebSite3\
|
|
|
|
|
jojoba2010 wrote: msgMail.To = "info@itfarda.com";
To is a read only property. You need to pass the to address via constructor when you instantiate MailMessage class. See documentation[^].
jojoba2010 wrote: txtContactUs.txt;
txt is not a valid property. Try txtContactUs.Text .
These are very basic stuff and I suggest you to get a good book on the subject and start reading it.
Best wishes,
Navaneeth
|
|
|
|
|
If I remember correctly, I have posted you the code few days back. See I have wrote this code in CP's editor itself, that why some mistake is there. But from the error it is quite understandable.
Please do as navaneeth suggested.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
How to integrate Asp.net application using sqlserver with Quick books
Dre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
Kashif ilyas wrote: Quick books
You can't unless quick books provide some API to access their data.
Best wishes,
Navaneeth
|
|
|
|
|
Kashif ilyas wrote: Quick books
What is that ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
first of all thankz ur reply
Quick book is accounting software
Dre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
|
How to call javascript function in page_load event without any control attachment
Dre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
|
Try This one,
Use this code in your Code Behind
Page.ClientScript.RegisterStartupScriptthis.GetType(), "JSFunc", "MyFunc();", true);
This is your JavaScript Code :
<script type="text/javascript">
function MyFunc()
{
alert('JS Calling From Code Behind');
}
</script>
Hope this will help you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thankz Abhijit Jana
Dre@m is not th@t wh@t u see in sleep.Dre@m is the thing which does not allow u to sleep
|
|
|
|
|
Page.ClientScript wont work in case if you are using AJAX in your page.At that time use Scriptmanager to register the clientscrit as
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), this.ClientID, "MyFunc();", true);
Rest will same as Abhijit said.
Cheers!!
Brij
|
|
|
|
|
you can also achive same thing by using jquery. and for more detail check jquery documentation on jquery site
<script type="text/javascript" src="JavaScript/jquery.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
alert('page loaded');
});
|
|
|
|
|
Hi,
method1. code behind: this.Page.RegisterStartupScript(string key, string script);
method2. put your javascript function content(just the content) in the *.aspx body or div.
modified 27-May-14 4:57am.
|
|
|
|
|
I added checkbox on gridview this method:
asp:TemplateField>
<
ItemTemplate>
<
asp:CheckBox runat="server" ID="CheckBox1" />
</
ItemTemplate>
I want to save selected values another table but I did not achive.First I try this code and then I will convert this delete statement to select statement ,it deletes checked value but there is sql exception ID =@ID and keyid=@keyid"; I think this values should be primary key,but I cant set primary key in a table both of them(keyid my primary key now I need this primary key when user select one row ).Please give idea,I tried most of things and tired
string connStr = ConfigurationManager.ConnectionStrings["bdConnectionString"].ConnectionString;
string sql = "Delete From ekleme Where ID =@ID and keyid=@keyid";
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.CommandType =
CommandType.Text;
SqlParameter keyid = cmd.Parameters.Add("@keyid", SqlDbType.Int);
SqlParameter ID = cmd.Parameters.Add("@ID", SqlDbType.Int);
keyid.Value = Session[
"keyid"];
string str = "";
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked =((CheckBox)row.FindControl("CheckBox1")).Checked;
if (isChecked)
{
str =
"Seçildi";
conn.Open();
ID.Value = GridView1.Rows[i].Cells[0].Text;
cmd.ExecuteNonQuery();
}
}
Response.Write(str);
|
|
|
|
|
How to use Timer to refresh this Code
Visitors online: <%= Application["OnlineUsers"].ToString() %>
in regular intervals without refreshing the whole page !
|
|
|
|
|
Have the variable in a small DIV. Have a small window.setTimeout function to be called repeatedly based on timer and use XmlHttpRequest to fetch the value from the server and paint the DIV alone.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Sorry !
I am Shame to say that ....
Will you please
give example Step by Step so i can understand it better (Cause i am new to ASP.net) and have to finish my project for this Wednesday !?
|
|
|
|
|
Try looking at this Linky[^]
modified on Tuesday, January 12, 2010 11:28 AM
|
|
|
|