|
hi my brother
the code that i wrote is in c# you can convert it in vb.net easily.
you don't need that the detailsview is postback or not because the code that i wrote
can be implemented in ListBox Or DropDownList_SelectedIndexChanged Event
if you try my code your problem will be solved.
Essam Moustfa
|
|
|
|
|
I have two instance name for SqlServer.
I write this code :
SqlDataSourceEnumerator sqlserver = SqlDataSourceEnumerator.Instance;
DataTable dt = sqlserver.GetDataSources();
GridView1.DataSource = dt;
GridView1.DataBind();
but when i run it , i couldn't see the result! What Should i Do?
[]D @ []v[] []D @ []v[]
modified on Thursday, May 7, 2009 8:23 PM
|
|
|
|
|
pampam110 wrote: but when i run it , i couldn't see the result! What Should i Do?
Did you debug your code? What dt returns ?
|
|
|
|
|
thanks for reply
i named my datatable as dt, and put all sqlserver instance name in that.
and then try to fill it in gridview!
yeah, i debug it! but it didn't show any result.
any idea?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
I had a working ASP.NET 3.5 project, and I wanted to move the project files from a network drive to my C drive. I deleted the .sln file, copied the pages, codebehinds, and classes to my C: drive, created a new project in VS2008, and added the files to it. Now when building I get errors on about 10 out of 31 pages: "Could not load type 'pagename'". And that's the only errors shown. Googling, I have seen numerous references to the codebehind not being referenced by the page, but I have checked and they are all correct. I don't know what code to upload to better describe my problem. Any ideas on what I should do next?
My other signature is witty and insightful.
|
|
|
|
|
Is it looking in the old location for the files ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
How can I tell? I started with an empty project, moved the files to the new directory on C, then added existing item for each one. So I would think it is looking in the new location. Plus, the new project doesn't "know" about the old location since it was empty of files.
My other signature is witty and insightful.
|
|
|
|
|
If you created a newly empty project? That maybe causes the error. I suggest you create a normal project including default files like default.aspx etc. And then delete these default files and copy your files to the new project.
Generally, the path of source codes is stored in the .sln file. You can open it with NotePad to check it.
Welcome to www.softwaretree.net!
This website is generated completely by static html pages transforming technology.
You can find many excellent audio/video tools there!
|
|
|
|
|
Perry Holman wrote: I suggest you create a normal project including default files like default.aspx etc. And then delete these default files and copy your files to the new project.
I thought that's pretty much what I did. But instead of deleting the files, I copied the original source for default.aspx, web.config, and global.asax to the files created by the new project. Then I copied each file in with "add new item". And I just now looked at the .sln and everything that seems to reference a path has a reasonable directory path in it, like so:
Debug.AspNetCompiler.VirtualPath = "/ProfRev"
Debug.AspNetCompiler.PhysicalPath = "..\ProfRev\"
But it sounds like it's time to start over, because maybe I zigged when I should have zagged. New project, copy in default.aspx, etc.; then add one file, build the page, add another file, build the page, repeat for 31 pages. Sounds like a fun thing to do on a Friday, huh?
My other signature is witty and insightful.
|
|
|
|
|
Within a stylesheet I copied to an ASP.NET project, the compiler does not seem to like the first line in the stylesheet.
Any idea why?
@charset "UTF-8";
@import url("reset-min.css");
body{
font: 62.5%/2.2em "Lucida Grande", Tahoma, Verdana, Arial, Helvetica, sans-serif;
color: #4b4942;
background: #fff;
}
...
Jon
|
|
|
|
|
jon_80 wrote: Within a stylesheet I copied to an ASP.NET project, the compiler does not seem to like the first line in the stylesheet.
How did you placed the stylesheet? Where did you placed it? Did you deployed the application in IIS?
|
|
|
|
|
I copied the stylesheet over from a template, and, I plan to use it as a Masterpage on my website. The application is deployed within the local IIS for now.
Jon
|
|
|
|
|
I am using the following code to populate a GridView in
protected void Button1_Click(object sender, EventArgs e)
{
String selectCommand = "select top 1000 claimid, formtype, status, totalpaid, paiddate from claim";
SqlDataAdapter ad = new SqlDataAdapter(selectCommand, SqlDataSource1.ConnectionString);
DataTable dt = new DataTable();
ad.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
This works, but I have AllowPaging = true, and the first time I click the "Next Page" button, I get a "PageIndexChanging not handled" exception. I have not setup a PageIndexChanging handler, but I didn't think I had to in this case.
BTW, when I populate by just setting the GridView1.DataSourceID to a SQLDataSource, the problem does not occur. Paging works fine.
What am I doing wrong? Thanks! Mark
|
|
|
|
|
Hi try this in your pageindexchanging event
gridview.pageindex = e.newpageindex
String selectCommand = "select top 1000 claimid, formtype, status, totalpaid, paiddate from claim";
SqlDataAdapter ad = new SqlDataAdapter(selectCommand, SqlDataSource1.ConnectionString);
DataTable dt = new DataTable();
ad.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
You are binding the DataSource manually, so in this case you have to override the PageIndexChanging and PageIndexChanged handler. For example,
protected void GridViewXXX_PageIndexChanged(object sender, EventArgs e)
{
this.SqlDataSourceXXX.SelectCommand = "XXX";
}
protected void GridViewXXX_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridViewXXX.PageIndex = e.NewPageIndex;
}
Welcome to www.softwaretree.net!
This website is generated completely by static html pages transforming technology.
You can find many excellent audio/video tools there!
|
|
|
|
|
we want to dataentry in gridview so we will take 6 fields
in grid ,and we want to do autogenerated textbox for every field
in pressin tab.how it will be.plz help soon.
thanks®ards
vivek sachan
|
|
|
|
|
hi
i want help you but your question is not clear
plz write again your question clearly.
Essam Moustafa
|
|
|
|
|
we take three rows & we take three multilinetextbox in each row,and we enter data all textboxes in first row ,when we go in 2nd row then size of all three textbox of first row will same automatically.how it is possible
plz give me advice,
thanks®ards
vivek sachan
|
|
|
|
|
onblur and a javascsript method to resize them
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' System.Web.Mail.SmtpMail.SmtpServer is obsolete in 2.0
' System.Net.Mail.SmtpClient is the alternate class for this in 2.0
Dim smtpClient As New SmtpClient()
Dim message As New MailMessage()
Try
Dim fromAddress As New MailAddress(txtEmail.Text, txtName.Text)
' You can specify the host name or ipaddress of your server
' Default in IIS will be localhost
smtpClient.Host = "localhost"
'Default port will be 25
smtpClient.Port = 25
'From address will be given as a MailAddress Object
message.From = fromAddress
' To address collection of MailAddress
message.[To].Add("anup2005debnath@gmail.com")
message.Subject = "Feedback"
' CC and BCC optional
' MailAddressCollection class is used to send the email to various users
' You can specify Address as new MailAddress("admin1@yoursite.com")
message.CC.Add("anup2005debnath@gmail.com")
message.CC.Add("anup2005debnath@gmail.com")
' You can specify Address directly as string
message.Bcc.Add(New MailAddress("anup2005debnath@gmail.com"))
message.Bcc.Add(New MailAddress("anup2005debnath@gmail.com"))
'Body can be Html or text format
'Specify true if it is html message
message.IsBodyHtml = False
' Message body content
message.Body = txtMessage.Text
' Send SMTP mail
smtpClient.Send(message)
lblStatus.Text = "Email successfully sent."
Catch ex As Exception
lblStatus.Text = "Send Email Failed." & ex.Message
End Try
i got error "failed to send message" plz solve the problem
|
|
|
|
|
you don't have to specify message.isbodyHTML if you want to set it false (that's default)
But for failing to send the message...Do you have IIS and SMTP setup correctly on your local machine that's running this?
|
|
|
|
|
is there any way to set up iis and smtp server
than plz tel me.
Actualy i m new in this topic
|
|
|
|
|
Any_India wrote: smtpClient.Host = "localhost"
'Default port will be 25
smtpClient.Port = 25
Does your SMTP Server configured Properly ?
|
|
|
|
|
|
I need add a confirmation box while updating modifications in the Edit part via GridView_RowUpdate.
MessageBox only works as server-side, but not client-side.
I did some search and found that I can extend the properties of commandfield.
But the problem is how can I call the new extended namespace/class from my current page in website?
Assembly only works for project right?
Thanks a lot for your response.
|
|
|
|