|
I was pointing some chances that may stop CSS functioning. Is all that OK in your case ?
|
|
|
|
|
I think the event in which you write your code must be raised after page_initialization or page load event
that's why this code doesn't have any affect
|
|
|
|
|
How can i enable or extend my visual studio 2005 compactible with .dbml files
or Object Relation or class diagram files
Any Idea
Please spent a moment for me
Thanks in advance...............
Riyam Hussain
SE
IDSi Technologies
Infopark, Kochin
|
|
|
|
|
AFAIK, VS2005 do support class diagrams.
|
|
|
|
|
How should i use the can grow field in cross tab crystal report.It is not showing me the full details in a column
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Urgent
Please help..
I am trying to display a file(.doc,.pdf or .img) from database to iframe embeded in a gridview.
i have used the following code below. its showing error.
The error is
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'http://localhost:2809/WebSite3/getimage.aspx?ID=11'. ...
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshf
^
In MainPage.aspx
public partial class Default8 : System.Web.UI.Page
{
ClsData clsd = new ClsData();
string sqlstr;
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
sqlstr = "select ID,Extension,Content from TestTable ";
ds = clsd.SelectDataSet(sqlstr, "temp");
Gridview1.DataSource = ds;
Gridview1.DataBind();
}
}
The design is
<asp:gridview id="Gridview1" runat="Server" autogeneratecolumns="false">
<columns>
<asp:boundfield datafield="ID" headertext="ID" visible="false">
<asp:boundfield datafield="Extension" headertext="Extension" visible="false">
<asp:templatefield headertext="Content">
<itemtemplate>
<![CDATA[<%# "getimage.aspx?ID=" + DataBinder.Eval(Container.DataItem,"ID") %>]]>' id="MyIframe" />
In getimage.aspx
public partial class getimage : System.Web.UI.Page
{
ClsData cdtd = new ClsData();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
try
{
IDataReader dr = null;
string id = Request.QueryString["ID"].ToString();
string sqlstr = "SELECT Content FROM TestTable where ID='" + id + "'";
dr = cdtd.SelectReader(sqlstr);
dr.Read();
byte[] byear = (byte[])dr["Content"];
Response.ContentType = dr["Content"].ToString();
Response.BinaryWrite(byear);
}
catch (Exception ex)
{
throw ex;
}
}
|
|
|
|
|
vineesh v wrote: Urgent
Please read this[^]. It's very URGENT
|
|
|
|
|
thats just a great answer
|
|
|
|
|
I have a datagrid already binded with dataset. And i have two columns the first column contains Image and the second column contains a table . In the table i have two rows. And in particular column say 2nd row 2nd column i have to create number of linkbutton which i get from another query.
This is way i have done my codes. But i am not able to display Total number of linkbuttons .
public string Call_Author(string IsbnID)
{
string AutnorName="";
DataSet ds;
ds = objAddDL.Call_Author(IsbnID);
string allname="", AuName="";
foreach (DataRow dr in ds.Tables[0].Rows)
{AuName = dr[0].ToString();
}
string tempAu = Server.UrlEncode(AuName);
return "" + AuName + "";
}
VanithaVasu
|
|
|
|
|
Are you able to assign required number of link button to the correct cell ? The code which you supplied doesn't make any sense to me.
|
|
|
|
|
Ya , i got it. But can u tell me is there any other Simple way .
And here is my code which worked out. But if this method , i implemented it make be coding conjusted when i have to do some operations on selection of the particular linkbutton.
HTML
--------
<asp:label runat="server" text="Author" forecolor="ButtonShadow" id="AuthorLbl" font-size="Small"><asp:linkbutton id="Lb" runat="server" text="">]]>'>
CodeBehind
-----------
public string Call_Author(string IsbnID)
{
ArrayList AuthorCount = new ArrayList();
DataSet ds;
ds = objAddDL.Call_Author(IsbnID); // Select query to fetch all author names where IsbnId="someruntimevalue";
string AuthorName="";
foreach (DataRow dr in ds.Tables[0].Rows)
{
AuthorName = dr[0].ToString();
AuthorCount.Add(AuthorName);
}
string retval="";
int ACount = AuthorCount.Count;
if (ACount == 1)
{
retval = "" + AuthorCount[0].ToString() + "";
AuthorCount.Clear();
}
if (ACount == 2)
{
retval = "" + AuthorCount[0].ToString() + "" + " , ";
retval += "" + AuthorCount[1].ToString() + "";
AuthorCount.Clear();
}
if (ACount == 3)
{
retval = "" + AuthorCount[0].ToString() + "" + " , ";
retval += "" + AuthorCount[1].ToString() + "" + " , ";
retval += "" + AuthorCount[2].ToString() + "";
AuthorCount.Clear();
}
return retval;
VanithaVasu
|
|
|
|
|
If i open an browser it as to asks username and password.if it correct then only it has to open.how to do it in asp.net using c#
gopi
|
|
|
|
|
You can't. You can make your SITE work that way, but not the whole browser. If you mean the former, then there's tons of info on the web on how to do that using your own system or the built in ones. If you mean the latter, then you have no idea how ASP.NET works, or what it is, and should do some reading on the topic.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i think you may be able to set it up so that if you enter the wrong username and password then ie will close but I don't think you can achieve what els you were saying
|
|
|
|
|
Perhaps an IE add in could do that, but ASP.NET cannot stop you going to another page.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear All,
I sent a HTTP request to a ASP.NET page, which including Tradition Chinese character. Such as:
http:\\www.mydomainname.com\myfolder\mypage?lastname=?
(The URL is in utf-8 encoding should be)
and then I cannot get the traditional Chinese character properly with the page of ASP.NET C# in server side. Such as:
this.m_strLastNameIn = Request.QueryString["lastname"];
then the value of m_strLastNameIn become: ??
The HTTP GET Request is sent by my MFC C++ WIN32 application with utf-8 URL with URLDownloadToFile() function. Such as:
URLDownloadToFile(NULL, wszURL, wszStoragePath, 0, 0)
where wszStoragePath is wchar_t[1024] under C++;
How can I solve this problem?
I want to get the traditional Chinese character properly at ASP.NET C# page.
|
|
|
|
|
The problem during writing into an existing cookie, after re running my web application
hi to all forums members
can any one tell me what is error in mine code, It create every time a new cookie, but i have to write into existing cookie.
When i close my web application and re running my web application and, adding values into cookies it creates new cookies... why I m unable to understand....
following is my code...
protected void btnAddCokkie_Click(object sender, EventArgs e)
{
CreateAndAddCookiesValue();
}
private void CreateAndAddCookiesValue()
{
//Response.Cookies.Remove("ShowHistoryCookie");
if (Request.Browser.Cookies == true)
{
// Check the cookie Mycookie exist or not
if (Request.Cookies["ShowHistoryCookie"] == null)
{
// If does Mycookie does not exist then create the cookie
HttpCookie aShowHistoryCookie = new HttpCookie("ShowHistoryCookie");
Response.Cookies.Add(aShowHistoryCookie);
// set expires to the datetime maxvalue
Response.Cookies["ShowHistoryCookie"].Expires = DateTime.Now.AddMonths(1);
//Response.Cookies["ShowHistoryCookie"].Expires = DateTime.MaxValue; //DateTime.Now.AddMonths(1)
Response.Cookies["ShowHistoryCookie"]["URL"] += txtUrlLink.Text;
}
//Append UrlLink into existing cookie
else
{
string strCookie = Request.Cookies["ShowHistoryCookie"]["URL"].ToString();
string strCook = strCookie;
strCookie += "|" + txtUrlLink.Text;
char[] splitter = { '|' };
string[] arInfo = new string[10];
arInfo = strCook.Split(splitter);
int count = arInfo.Length;
int intResult=-1;
bool flag = false;
//count to Restrict cookie to Store 10 UrlLink
if (count <10)
{
//check to ensure that no duplicacy in UrlLink of cookies
foreach (string str in arInfo)
{
intResult = str.CompareTo(txtUrlLink.Text);
if (intResult == 0)
{
flag = true;
break;
}
}
if (flag==false)
{
Response.Cookies["ShowHistoryCookie"]["URL"] = strCookie;
}
}
//Sorting cookies to ensure that only ten recents Url link are added only...
else if (count >= 10)
{
foreach (string str in arInfo)
{
intResult = str.CompareTo(txtUrlLink.Text);
if (intResult == 0)
{
flag = true;
break;
}
}
if (flag == false)
{
for (int i = 0; i < 10; i++)
{
//Swaping
if (i + 1 >= 10)
{
arInfo[9] = txtUrlLink.Text;
break;
}
else
{
arInfo[i] = arInfo[i + 1];
}
}
strCookie = arInfo[0] + "|" + arInfo[1] + "|" + arInfo[2] + "|" + arInfo[3] + "|" + arInfo[4] + "|" + arInfo[5] + "|" + arInfo[6] + "|" + arInfo[7] + "|" + arInfo[8] + "|" + arInfo[9];
Response.Cookies["ShowHistoryCookie"]["URL"] = strCookie;
}
}
}
}
else
{
// Else display message that
// the browser does not accept cookies
Response.Write("This Browser does not accept cookies");
}
Vishnu Narayan Mishra
Software Engineer
|
|
|
|
|
Whoah!! What is this... I've created a web-application which runs on 144 seperate websites. Those websites are pretty equal and therefore pointing to the same Home Directory (local path). The app. is written in asp.net 2.0 and uses SQL Server 2005 as data source.
We're test running the app since a month or so and depending on the server load, the following exception occurs in about four days of running :
Failed to initialize the AppDomain:/LM/W3SVC/1993985091/Root
Exception: System.SystemException
Message: Failed to create AppDomain.
StackTrace: at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
InnerException: System.OutOfMemoryException
Message: Exception of type 'System.OutOfMemoryException' was thrown.
StackTrace: at System.AppDomain.nCreateDomain(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor)
at System.AppDomain.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
I've been trying to find the cause of this excepion but cannot find any reason why this exception occurs. I've been looking for memory leaks since there's obviously a memory problem... The websites are pretty frequently visited so we expect a large amount of traffic. Anyway, i'm pretty much determined to get the cause of this exception, but i'm quite stuck here...
Any suggestions?
|
|
|
|
|
i have 3 gridview
on selected index change of first gridview(company), I populate second gridview(users) on second gridview selected index change i display a list of jobs that are available (in a listview) and list of jobs assigned (in gridview) and roles associated with that job (checkbox in a 3rd gridview)
when i need to assign a job to the user i simply do followings
1. click company from 1st gridview
2. click user from 2nd gridivew
3.select a property from available property
and click a button that adds a new record in the assigned gridview but i want to display the newly added row as soon as they hit assign button. i need to reselect the user to see the updated change. is there anyway i could achieve this without using session?
please advise.
|
|
|
|
|
Oh, you were crossposting. I see. Please don't do that.
If you want to update without postback, it has nothing to do with the session, it has to do with AJAX.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris
you have mentioned using either URL parameter or view state. now i cant use URL parameter as its a requirement.
here are few codes to help u understand.
Private Sub gvUsers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvUsers.SelectedIndexChanged
dsAssignedPropertyList = mydal.SecurityGetAssignedPropertyByUser(domainid, CompId, userid)
If Not dsAssignedPropertyList Is Nothing Then
gvAssignedProperty.DataSource = dsAssignedPropertyList
gvAssignedProperty.DataBind()
end sub
Protected Sub btnAssign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAssign.Click
Dim myDAL As New clsDAL
Dim result As Boolean = False
userid = CInt(lblUserId.Text)
propertyid = lbAvailableProperty.SelectedValue
result = myDAL.SecurityAssignProperty(userid, propertyid)
If result Then
lblMsg.Text = "updated"
Else
lblMsg.Text = "failed"
End If
End Sub
In first method i am populating gvAssignedProperty and in second method i managed to insert the record and display a message but i really want to show the added record in a grid. could you please help?
thanks
|
|
|
|
|
I re-queried the DB again in button click event and bind the data.
|
|
|
|
|
and you still have the issue ? What is the issue then ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So you're doing postbacks here, you said you wanted to avoid that ?
Is the issue that your postback adds a record but it's not visible when the postback ends ? You should be reading your datasource and databinding after you insert the record, or, in your prerender method. It depends on if you want to bind every time to save viewstate, or use viewstate to store records and save DB resources.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi! the issue is. I have a grid A which populate when selected index of parent grid B is changed.
In Grid A i have button template "Remove" which should remove the records. well for now it removes the record from DB but i need to again change the index of grid B to show updated record in a grid. so my issue is how could i display updated record in grid A right after I click remove.
cheers.
|
|
|
|