|
Magh_M wrote: ow to use vb codes in asp.net,
Convert your vbcode into dll and refer that here
|
|
|
|
|
Morning
am a beginner in (programming)asp.net(vb).Please help me with the code,After the user selected the value from the dropdownbox,and enter some in the textboxes,when the user click add entry(button),the values to be anded to the database and be displayed in the datagrid,for modification.
Thank you in Advance.
oga m
|
|
|
|
|
Explaining the entire thing through forums is space consuming. so try to get some article explaining
1. SQLConnection class
2. SQLCommand
3. Executing query to SQL DB
Oga M wrote: displayed in the datagrid,for modification.
Getting value to some dataset and use datagrids datasource property to display it on grid
|
|
|
|
|
In sqlcmd write insert query,
after that using dataadapter get the table,
then fill it in to dataset,
then datasource put it in to datagrid,
then bind the data in datagrid using databind,
Magi
|
|
|
|
|
Hi. Oga.
This is very simple thing.U need to learn about asp.net.
Take it and try to do urself
Link[^]
Best of Luck
Best Regard
Pathan
|
|
|
|
|
Hi friends,
I am facing a PROBLEM WHILE I send mails with the SMTP class of System.Net.Mail.
The code shows below.
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("from@domain.com");
mail.To.Add("to@domain.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("mysmtpserver.net");
//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new System.Net.NetworkCredential("user@domain.com", "password");
smtp.Send(mail);
I have a valid smtp server name, username and password. I configured it to outlook and working fine. And wen I test it using telnet port 25 then also its working.
I upload the file to my hosting space. I have two hosting account with godaddy.
The mailing script is working fine in one hosting account. That hosting account have SSL and dedicated IP address.
But the mailing code is not working in the other hosting account. That hosting account is Windows hosting + ASP.NET 2.0 supported.
The error I am getting is as shown as below.
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
Please help me on this issue....
Thanks in advance....
JIJO BABY - Lets Play C#
|
|
|
|
|
how can i add attribute for a control in datagrid for javascript valiation?
i gave Dim hl As New HyperLink
hl = e.Item.FindControl("HyperLink1")
but showing error "Object reference not set to an instance of an object"
thks
yesu
|
|
|
|
|
when a grid is rendered on to the page ..ID of the control changes as DataGrid_ct1_... so use find control for this ID ...then it will work
Koushik
|
|
|
|
|
i find the control with this id..but it didt work.what is will be the full id for that?
i find by:
Dim hl As New HyperLink
hl = e.Item.FindControl("DataGrid_ct1_")
pleas make me correct..
thks
|
|
|
|
|
The id will be ataGrid_ct1_ + yourcontrolname
|
|
|
|
|
Hi
When grid is binded, it will raise ItemDataBound Event. You will get the current row in parameter e. Use that parameter and find the control. After that add attribute. It could be something like
HyperLink hyp = (HyperLink) e.Item.Cells[YourCellIndex].FindControl("HyperLink1");
|
|
|
|
|
i didt got the result
i am doing in vb.net
my code is
Dim hl As New HyperLink
hl = e.Item.Cells(0).FindControl("HyperLink1")
showing "Object reference not set to an instance of an object"
pls correct me..
thks
|
|
|
|
|
Protected Sub GVCartView_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVCartView.RowDataBound<br />
<br />
If e.Row.RowType = DataControlRowType.DataRow Then<br />
Dim btn As HyperLink= e.Row.FindControl("HyperlinkID")<br />
btn.Attributes.Add("onclick", "return function();")<br />
End If<br />
End Sub
I have done it in my project and its working
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
Hi guys,
Could some one help me out? I have a datagrid where one Row is for
selecting from radiobuttonlist of too, one has to be chosen. When it's
chosen it is stored in the database and appears to the datagrid after
the insert button pressed. But now I have two images that are supposed
to correspond each of the radiobutton. I made them visible="false" but
I want when one selects one radiobutton the corresponding image
appears along: Visible="True". How could I go about this?
Thank you
|
|
|
|
|
nclauder wrote: I want when one selects one radiobutton the corresponding image
appears along: Visible="True".
When radio button got the click call one javascript function. use the following code for hiding and showing image, let me assume all your image having unique id's.
document.getElementById("imageid").style.visibility = "none"
document.getElementById("imageid").style.visibility = "block"
|
|
|
|
|
Thanks Navaneeth,
I'm getting a little bit lost. When you give me this code how I'm i supposed to fix it into my code this is the code I'm using for the radiobutton.
The behind code:
protected void rblmood_SelectedIndexChanged(object sender,System.EventArgs e)
{
RadioButtonList rbl = (RadioButtonList)sender;
Control parent = rbl.Parent;
while(!(parent is System.Web.UI.WebControls.DataGridItem))
{
parent = parent.Parent;
}
}
protected int SetState(object st)
{
string state = st.ToString();
if(state.Equals("True"))
{
return 0;
}
else
{
return 1;
}
}
Html code is:
<asp:templatecolumn headertext="Mood Today">
<itemtemplate>
<asp:image id="imggm" runat="server" visible="False" imageurl="file:///C:\Inetpub\wwwroot\DashBoard\Moods\laughing.gif">
<asp:image id="imgbm" runat="server" visible="False" imageurl="file:///C:\Inetpub\wwwroot\DashBoard\Moods\sad.gif">
<asp:label id="Label2" runat="server" text="<%# DataBinder.Eval(Container,"DataItem.MoodToday")%>">Label
<edititemtemplate>
<asp:radiobuttonlist id="rblmood" runat="server" width="104px" autopostback="True" selectedindex="<%#SetState(DataBinder.Eval(Container.DataItem,"MoodToday"))%>" height="40px">
<asp:listitem value="Good Mood">Good Mood
<asp:listitem value="Bad Mood">Bad Mood
Thanks.
-- modified at 5:03 Friday 9th March, 2007
|
|
|
|
|
I have just tried your advice but I get an error:
The type or namespace name 'document' could not be found (are you missing a using directive or an assembly reference?)
What wrong?
Thanks.
|
|
|
|
|
Hi all
i have one doubt
How many config files we can have in one project ?
From my knowledge we can have as many as we have Directoreis in the project i.e each web.config for each directory ?
Here Directory Means What ? Folder where i have my pages here i am confused )
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
sandeep akhare wrote: How many config files we can have in one project ?
I think we can have only one web.config file for one website. If you are placing web.config file for each directories, i think it will be treated as different websites. Normally in my projects i do use directories. But all files inside these directories will be referring the root config file only.
|
|
|
|
|
HI Navaneeth
i thought same but after reading in MSDN i am confused
From MSDN
Configuration File Hierarchy and Inheritance
Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories. Configuration settings in a Web.config file can optionally be applied to individual files or subdirectories by specifying a path in a location element.
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi Sandeep
That was a good post.
sandeep akhare wrote: Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories
I tried this but i am getting error. Still it is refering the parent config file only. Any idea to override that in child directories ?
|
|
|
|
|
Navaneethkn wrote: That was a good post.
Thanks Navaneeth
Thats why i am also confused i didn't try it out but should know basic concept behind it thats why posted on forum
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi u can use more than one webconfig file in ur project,
its possible,but one webconfig file will be in normal,
other webconfig files want to be based on where its used in that folders we want to put it...........,
eg:take role based authentication,
eg,admin,user each one have diff roles,so in admin folder u must tell ur webcofig file for that,
like that user folder also u want to mention ur webconfig,
then normally outside one webconfig file will be there....
i hope u will understood..........
Magi
|
|
|
|
|
Thats nice
but can you provide one example/article where i can play with it
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
have the coding to encrypt password:
private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack == false) {
ddlChooseAlgo.Items.Add("");
ddlChooseAlgo.SelectedValue = "";
}
}
private void cmdEncryptValue_Click(object sender, System.EventArgs e)
{
txtShowValue.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(txtGetValue.Text, ddlChooseAlgo.SelectedValue);
}
Here the encryted value is dispalyed in the textbox.My problem is to insert the encrypted password value into sql database...Please anyone give me a idea to insert into sql
With Regards,
Samson
|
|
|
|