|
I'm not sure at what level you are manually coding to "get tables holding values" but if you are databinding a control to a datasource you can clear that control by binding to a null value.
If you are dynamically writing out HTML to the page then you should write it out to a Literal control and to clear it, you can assign it an empty string.
|
|
|
|
|
Dear Bright..
How to write the HTML to a literal control and clear it..? Can u just give me some sample code to do that..?
Thanks & Regards,
Balaguru
|
|
|
|
|
Create a literal control:
<asp:Literal ID="Literal1" runat="server"></asp:Literal> Add some HTML:
this.Literal1.Text = "... enter html here ..."; Clear the HTML:
this.Literal1.Text = string.Empty;
|
|
|
|
|
Hello...
i want to use Custom pageing in grid view..How to give custom pageing in asp.net.
|
|
|
|
|
You must not have heard of it before, so let me tell you about a brilliant website called Google, it lets you do magical things like search for solutions to problems, here is an example which might help you: gridview+custom+paging[^].
|
|
|
|
|
Just like.. in Google...display paging in buttom...
i think this is not default paging..this is custom paging.
in custom pageing there is only these page of data are bound...
|
|
|
|
|
raushan_9 wrote: want to use Custom pageing in grid view..How to give custom pageing in asp.net.
Try reading this[^], have a think about what you actually want help with and then come back and ask a sensible question.
|
|
|
|
|
actually ..as we know gridview have own property of pageing..
this is default .
but i am asking Custom paging...
i do not want to do through allow paging.
but when we use default paging it fetch all the records from the database.
but in custom pageing it fetch only one page records at a time...
please check this url..then reply in a sensible manner...http://www.worldofasp.net/tut/Paging/Improve_Your_DataGrid_Paging_performance_128.aspx[^]
|
|
|
|
|
You have explained things a little better this time, the word "Custom" can have many meanings and it was not clear what you meant is your previous posts.
I'm glad to see that you have found an article that describes what you want to do, and how to do it.
|
|
|
|
|
Actually...I am developing a project. and i have used gridview in many pages. so i want to give paging..but i dont want to give normal paging..
actually i want to give own paging on basis of code.
Just like u see in google search paging.it showslike this 1 2 3 4 Next.
so plz give apropriate way to give own(custom) paging in gridview.
|
|
|
|
|
The url in your previous post describes how to do it, which aspect of the code are you having a problem with?
|
|
|
|
|
hi all iam using a javascript file referenced inside a page. In this script iam referencing a JS function found inside the page. It is generating an error."The Controls collection cannot be modified because the control contains code blocks (i.e. )."
the code is as follows
External JS:
var ok =false
....some code
if (!answer)
{
ok=false;
CloseOnOk();
}
where CloseOnOk is a javascript function found on the page
function CloseOnOk()
{
if (ok==true)
GetRadWindow().Close();
else if (ok==false)
{
var txthidden=document.getElementById('<%=txtHidden.ClientID %>');
txthidden.value='1';
}
}
iam also referencing the external javascript from the page
<script language="javascript" type="text/javascript" src="../../Scripts/Confirmation.js"></script>
Any ideas??
|
|
|
|
|
Its not clear which piece of code is throwing the error but you can try commenting out the GetRadWindow().Close(); line to see if that is the problem.
Also try changing txthidden.value='1'; to txthidden.innerHTML='1'; .
|
|
|
|
|
The error appears on the ecternal JS line where iam calling CloseOnOk();
it is not calling this function.
|
|
|
|
|
i want to use session variable in global.asax
when using folowing code.
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
if (Session["role"] != null)
{
//strRole = Session["role"].ToString();
}
}
it gives error.>> Session state is not available in this context.
Please solve my problem as soon as possible.
Thanking u
ajai
|
|
|
|
|
ajau wrote: Session state is not available in this context.
The error message is very clear enough. You can't use session in this event as it's not instantiated. Application_AuthenticateRequest is in the early stage of ASP.NET page life cycle. AcquireRequestState is the event where session will be created. So choose any event that fires after AcquireRequestState .
|
|
|
|
|
Hi!
I used Win XP Pro to develop an ASP.NET application. Everything is working fine in Win XP Pro. I published/deployed the same application into the Win Server 2003 Standard Edition. The website loads correctly, but I am not able to insert/update/delete data.
I have enabled Named Pipes and TCP/IP.
No errors are shown. The page just refreshes after I click the submit button without showing the new updates.
Hope someone can help me with this prob!
Thanks in advance.
|
|
|
|
|
guardianhm wrote: Urgent: Database not updated
I am sure you will get plenty of replies as the question is URGENT
|
|
|
|
|
I m writing code for updae the dyndns for my webcam
I m using this code to implement this task
<br />
<br />
Private Sub dyndnsupdate(ByVal ip As String)<br />
<br />
Try<br />
Dim data(1024) As Byte<br />
Dim response As String = ""<br />
Dim count As Integer<br />
Dim socket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)<br />
<br />
Dim host As IPHostEntry = System.Net.Dns.Resolve("professionalbkn.dyndns.org")<br />
Socket.Connect(DirectCast((New IPEndPoint(host.AddressList(0), 80)), EndPoint))<br />
<br />
If Not Socket.Connected Then<br />
Throw New Exception("Can´t connect to dyndns service")<br />
End If<br />
Dim request As String = "GET /nic/update?" + "system=dyndns" + "&hostname=" + _<br />
Me.hostName + "&myip=" + "&wildcard=" + "ON" + _<br />
"&offline=NO " + "HTTP/1.1" & Chr(13) & "" & Chr(10) & "" + _<br />
"Host: members.dyndns.org" & Chr(13) & "" & Chr(10) & "" + _<br />
"Authorization: Basic " + Me.userID + _<br />
":" + Me.password + "" & Chr(13) & "" & Chr(10) & "" + _<br />
"User-Agent: .net dyndns client" & Chr(13) & "" & Chr(10) & "" & Chr(13) & "" & Chr(10) & ""<br />
<br />
count = Socket.Send(System.Text.UnicodeEncoding.ASCII.GetBytes(Request))<br />
<br />
count = Socket.Receive(Data)<br />
While Not count = 0<br />
Response += System.Text.ASCIIEncoding.ASCII.GetString(Data, 0, count)<br />
count = Socket.Receive(Data)<br />
End While<br />
<br />
Socket.Shutdown(SocketShutdown.Both)<br />
Socket.Close()<br />
<br />
Response = Response.Substring(Response.IndexOf("\r\n\r\n") + 4)<br />
But it gives error that :
HTTP/1.1 404 Not Found
Server: Unknown/0.0 UPnP/1.0 Web Server
Connection: close
404 Not Found
Hope some one can understand my problem & will help to solve this problem
Thanks with anticipation
The Great Pleasure In Doing That Things That Other People Say U Can't By Doing This U Can Shut Their Mouth
|
|
|
|
|
Is anybody there who can give some idea,link,info anything?????
Any idea would be appreciated
The Great Pleasure In Doing That Things That Other People Say U Can't By Doing This U Can Shut Their Mouth
|
|
|
|
|
hi all.i have developed this application to send email via ASP.Net(C#.net).now if i embedd an image using CID,the image is visible in outlook,but not in GMAIL,or Yahoomail even if i click to show picture.this,i guess is because the path of the image i am providing is of my system.and other systems can not access this path?the image dat i am embedding is not on the internet but its only at my system.so that means i cant provide any URL too.i dont want to send this image as attachment.i need to embedd it only.and i want it to be visible on Gmail or Yahoomail too..how can i do it?following is the code that i have written:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string fileName = FileUploadReciepent.PostedFile.FileName;
fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);
string filePath = Server.MapPath(".") + fileName;
FileUploadReciepent.PostedFile.SaveAs(filePath);
ExcelReader reader = new ExcelReader(filePath); //Create an Excel file Reader
reader.setCurrentWorksheet(1); //Set current worksheet as 1
Array al = reader.getRange("A1", "A3"); //Get A1 to A3 from worksheet 1
foreach (object cell in al) //Loop through all the cells
{
TxtTo.Text += cell + ",";
MailMessage message = new MailMessage();
message.From = new MailAddress(txtName.Text);
message.To.Add(TxtReceipent.Text);
message.Subject = txtsubject.Text;
message.IsBodyHtml = true;
message.Body = Literal1.Text;
LinkedResource image = new LinkedResource("C:\\My Documents\\My Pictures\\anything.jpg");
image.ContentId = "anything";
//add the LinkedResource to the appropriate view
//htmlView.LinkedResources.Add(image);
SmtpClient client = new SmtpClient("smtp.xxx.com");
client.Host = "xxx.xxx.xxx.xxx";
client.Send(message);
}
}
protected void BtnUpload_Click(object sender, EventArgs e)
{
TextReader a = new StreamReader(FileUploadContent.FileContent);
Literal1.Text = a.ReadToEnd();
}
}
FileUploadReciepent-file upload control that gets all the email ida from my excel sheet.
fileUploadContent-uploads the html content,with embedded image from my system.
I have searched all over the internet,but couldnt find any solution.hope u'll help me finding One!!!!!!
|
|
|
|
|
I don't think it is possible to embed images this way for web based email clients.
Your best option is to find a way of getting your images onto a public website and linking to them from there.
|
|
|
|
|
thanks for ur reply...please do tell if u come up with any idea any other time
|
|
|
|
|
Hi to everyone,
a stupid question:
I added an Ajax control to Visual web Developer, adding a reference to the .dll compiled file in the project..
Now I'd like to use it, but I can't declare it in the asp.net page...
I also would like to add it to the toolbox..How could I do this?
Thanks!
Bye
|
|
|
|
|
I'm don't use "Visual Web Developer" but try right-clicking on the toolbox and if there is an option called "Choose Items.." then you can browse to the dll of the control and this will add it to the toolbox.
|
|
|
|