|
I used Smilleys just for fun! and express the feelings but anyways i'll keep in mind your suggestion next time
|
|
|
|
|
Hi dears,
I am developing a web portal with ASP.NET 2.0 and c#
my protal has several phases such as personal pages,magazine,shopping,news,...
I want to make subdomain for each above subjects. Then I created a subdomain named "pages" in my host control panel to redirect any pages.mywebsite.com to mywebsite.com/pages/ address.
when I upload my default.aspx file to pages subdirectory and visite pages.mywebsite.com/default.aspx "the resource is not found" error accurs. but when I upload any html file to pages subdirectory I can access any of them correctly . I realy don`t know what the problem is.
kindly help me plz. ( sorry for my bad english)
www.behzadi.net
|
|
|
|
|
rdr is a SqlDataReader.
rdr have a table in which data are
"select BestForName,BestForID from BestForTable"
ddlBestFor is a drop down list.
when I try
ddlBestFor.items.add(rdr["BestForName"]);
I'm getting for ddlBestFor
text : all BestForName
value: 0,1,2,........
But I want to add like
text : all BestForName
value: all BestForID
I need hardly.
thanks a lot.
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Use the following code
objDataSet will have the set of records which are retrived using select query.
ddlBestFor.DataValueField = objDataSet.Tables[0].Columns[1].ToString();
ddlBestFor.DataTextField = objDataSet.Tables[0].Columns[0].ToString();
ddlBestFor.DataSource = objDataSet.Tables[0];
ddlBestFor.DataBind();
ddlBestFor.Items.Insert(0, "Select");
Bhanu
|
|
|
|
|
u have to set DataValue property also along with DataText
one way of doing this is the mentioned by other fellow in the above post
|
|
|
|
|
Hello Everybody,
I have GridView like below:
Name CustomerID Send
Rakesh 01234 Send
In this "Send" is a LinkButton. I need to develope it like when a user click on "Send", page should be redirect to a different page and value of "CustomerID" should go to the redirect page like Querystring.
Thanks in Advance
Happy Coding
A key to every Solution
|
|
|
|
|
Set your Link button's PostBackUrl into your redirect Page.
Get the CustomerId value By "PreviousPage" object
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
Thanks for reply.
But how can I get the CustomerID value from PreviousPage Object. That value should be the particular row value where the LinkButton is clicked.
plz if possible give me a sample.
Happy Coding
A key to every Solution
|
|
|
|
|
add onclick event for send button and calls a method written in code file
in that method just write
Response.Redirect("secondpage.aspx?"id) // id is the customerid passed from .aspx page
for example (.aspx file)
OnClick='<%# GetCommentURL(Eval("ArticleID").ToString()) %>'
(.cs file)
protected string GetCommentURL(string id)
{
return "Comments.aspx?id=" + id;
}
modified on Tuesday, January 29, 2008 3:01:18 AM
|
|
|
|
|
why don't you set linkbutton.commandargument = customerid
in itemdatabound/rowdatabound eventhandler
then set linkbutton.commandname = "send" in property page
then add itemcommand/rowcommand eventhandler
in this handler add this code
if (e.commandname == "send")
{
DoWhatYouWantToDo(e.commandargument);
}
i hope it helps
|
|
|
|
|
How to prevent a gridview row on viewing the data.If we have a data in a grid.I want to prevent the data on viewing..How is it possible.Please reply..
|
|
|
|
|
Place your Gridview inside the tag and set the div propery as follow
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
I made a simple report CrystalReport1.rpt which was added to my project
Now I want to use this report in my project:
CrystalReport1 = new CrystalReport1();
But I get this compile-error:
The type or namespace name 'CrystalReport1' could not be found (are you missing a using directive or an assembly reference?)
What is wrong?
|
|
|
|
|
What has this got to do with ASP.NET?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i have exported file to Excel......nw i need to retrieve the same excel file to my asp.net application
My excel file is like the given below :-
AssetID Description AssetTag
1246 hello me(1246) 10103001245
1247 hi me(1247) 10103001246
when am trying to import, am getting an error like " External table is not in the expected format "
wht might be the prblm.....
can anyone help me?
|
|
|
|
|
add this code
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=DCNReport.xls");
Response.Charset = "";
this.EnableViewState = false;
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
This is for while exporting the file.....
my code is like ths:-
Dim excelname As String = FileUpload1.PostedFile.FileName
Dim intFileNameLength As Integer = InStr(1, StrReverse(excelname), "\")
strFileName = Mid(excelname, (Len(excelname) - intFileNameLength) + 2)
Dim namewe As String = System.IO.Path.GetFileNameWithoutExtension(strFileName)
Dim sWorkbook As String = namewe + "$"
FileUpload1.PostedFile.SaveAs(Server.MapPath("ImportFiles/") + namewe + ".xls")
Dim oledbconn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("ImportFiles/") + namewe + ".xls ;Extended Properties=Excel 8.0;")
Comm.CommandText = "SELECT AssetID,Description,AssetTag FROM [" & sWorkbook & "]"
Comm.CommandType = Data.CommandType.Text
Comm.Connection = oledbconn
oledbadap.SelectCommand = Comm
oledbadap.Fill(oledbdatatbl)
GrdImpScanner.DataSource = oledbdatatbl.DefaultView
GrdImpScanner.DataBind()
am getting the error in this line :-
" oledbadap.Fill(oledbdatatbl) "
|
|
|
|
|
im trying to use the update panel but it updates the entire page as supposed to the update panel. i cant find what i have done wrong. can anyone help???
Many thanks in advance
====================================================================================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Label id="Label1" runat="server" Text="panel Created"></asp:Label>
</contenttemplate>
<triggers>
<asp:AsyncPostBackTrigger ControlID="Button1"></asp:AsyncPostBackTrigger>
</triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
===========================code behind================
Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "Refreshed at " & _
DateTime.Now.ToString()
End Sub
|
|
|
|
|
you can always try another method in using updatepanel.
example :
aspajax:updatepanel id="upGetContract" updatemode="conditional" runat="server"
contenttemplate
contenttemplate
triggers
aspajax:asyncpostbacktrigger controlid="btnSearch" eventname="Click"
triggers
aspajax:updatepanel
hope it help
nb : i dont know why if i give "<" or ">" the code will not be shown...
but i believe u got what i mean
|
|
|
|
|
Hi,
Our website provide users with a forum where they can enter messages. So, typically, a user would enter a message, click submit, and their message would be displayed on the forum.
The db that stores these msgs uses a varchar field. Now, we're adding a facility to convert any urls that are entered to links by adding 'a href' tags, so that when users see messages with urls, those urls appear as links, and they can click on them. The problem is that if a user enters a message of 8K chars, then we add 'a href' tags to any urls they have, that makes the message length > 8K, preventing us from storing it in our db. (Please note that we do need to add HTML tags for other reasons as well, not just to convert urls to links.)
We thought about adding 'a href' tags during pre-render, thus avoiding storing html in the db, but found that doing such string manipulations, while a user is waiting to see their post displayed on the forum, was expensive. Timing tests revealed that the time to render such pages more than doubled.
I have solved such problems previously by adding an extra field in the db to store any overflow data, that is, data that appears after the first 8K chars.
However, I learnt of sql server 2005's varchar(max) datatype, and 'am wondering if the best way to solve this problem would be to replace the varchar field with varchar(max).
Thanks in advance for any advice.
Shefali
|
|
|
|
|
Either use nvarchar(max) or ntext
only two letters away from being an asset
|
|
|
|
|
I have a form with 2 fields, say "name" and "tel" of a person.
My visitors may need to add from 1 to n persons
I need to display only fields for 1 record and a button that adds omre records' fields on the runtime as visitors' needs
I can use javascript code to create html form fields on the fly
Is there any better idea using ASP.NET powerfull controls?
Mohamed Gouda
Egypt
|
|
|
|
|
Hi there. You are probably best off using javascript as it will give your visitors the best experience in their browsers.
You could do it server-side by dynamically adding the text box controls in your Page_Load - something like Placeholder1.Controls.Add(tb) but as a user, I'd prefer the javascript route to avoid the server postbacks.
|
|
|
|
|
You could use a GridView, adding an empty record each time the user clicks the Add button. Of course the new row would need to be in edit mode. Unless you use an AjaxPanel this will produce postback flashing of course.
only two letters away from being an asset
|
|
|
|
|
Another way is create a user control having the fields that you want to add after clicking (2 text boxex)
Now add a repeater to your page bind this user control to repeater
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|