Web Forms :: Doubt About C# And VB.net / Put A New Page Written?
Apr 10, 2010I've a project of a web application that all the code is in vb.net. If I want to put a new page written in C# is that possible ?
View 2 RepliesI've a project of a web application that all the code is in vb.net. If I want to put a new page written in C# is that possible ?
View 2 Repliesim working with an web application where i need to call a java script confirm message like (r u sure u want to proceed) in the text changed event of a text which is present in item template of a grid view.if the answer is yes i want to do some calculations if no then
protected void txtQuandity_TextChanged(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "Test", "Quantity();", true);
}
In java script--
<script type="text/javascript">
function Quantity()
[code]...
currently i had two columns written in the page, both have a ItemTemplateI tried to bind an ArrayList into the gridview, and it worksProblem is:The binded data is added behind of the columns I written, and I want to set the visible="false" for the 3rd column and so on, when I did tat, it prompt an error message telling me the index was out of range, I tried to set the visible in Page_LoadComplete eventI able to set the 1st and 2nd written columns visible to false, what is the cause?
View 4 Repliesi have a asp.net application which is currently working in LAN / intranet my is the development server in which i have all the files , images and other functionalities its confiured thr' IIS so that other clinets in the INTRANET can access the aoolication. i have a email module which works fine . using this e mil modules i sent emails conating images, hyperlinks text etc to the gmail, yahoo etc ids and accessed it from my debelopment system asweel from other systems in the network.all of them work fine but if i sent it to a person who access the email outside the INTRANET the images nor the hyperlinks are displayed.only the text matter is displayed.
View 26 RepliesI am very new to thegridview control. As while searching for sample coding to edit the Gridview datas during runtime,i got the following codings protected void Edit(object sender, GridViewEditEventArgs e)
View 4 RepliesI have doubt in XML using in asp.netIn my project there are 15 forms and all are coded using C# and now I am going to add a new form using VB. And all the data using inside if that VB form from XML file.I have a Doubt How to write code inside to make connection with my SQL server 2008 and database.How to use Query String for retrieving data from data base and pass it to VB formPlease Do help me with small coding file with a little description.I am developing this form for to Create Event Calendar in ASP.net
View 1 RepliesI have two examples to show you what I want to achieve here. But to point what's different about my question, Is that I'm having a parametrized URLs and I want to implement URL rewriting to my application. But I don't want to convert the parameter in the URL to be placed between slashes..."page.aspx?number=one" to "pages/one/" << NOT!
First example:
http://localhost:1820/Pages/Default.aspx?page=2&start=5
To
http://localhost:1820/Pages/page2
Second example:
http://localhost:1820/Items/Details.aspx?item=3
To
http://localhost:1820/Items/ItemName
But I'll still need all the parameters in the original URLs
I'm using WCF service in my project.my doubt iswhen i used WCF service in windows application after each time a sevice is called i need to close it otherwise it will gives an error.
serviceClient objService = new serviceClient();
try
{
[code]...
I have an aspx page where I put a script tag with .net "if" and "else".The problem is that the output gets cut at random points each time. Sometimes it's ok, sometimes I get cropped output.The code itself (Simplified example):
<body id="body" runat="server">
<form id="form1" runat="server">some HTML
<script type="text/javascript">
[code]...
I am using code like this in Business Logic.Can u explian the below whether i am using Encapsulation concept in the below code.Also tell me why i should use private for declaring variable _Region and public for the property Region
private string _Region;
public string Region
{ [code]....
I am using a generic handler (indicator.ashx) to create a graphic that is overlayed from information from a table (called LIVE) from our SQL database. This is working very well and I am very happy with the results.
However I am having an undesirable issue where the query string that is used for this is also being accessed by another page (called ReceiveLive.aspx) which is populating our LIVE table with data when we don't want this. I have been able to track this issue down to our generic handler that seems to populate this table with data whenever the handler is accessed.
The query string that is used to access our graphic through our generic handler is
http://mydomain.com/indicator.ashx?ID=ABC001.
Our other page that writes data to our LIVE database used the query string
http://mydomain.com/live.aspx?ID=ABC001 which is normally only accessed by a small piece of software that sits on the users PC and sends the data when necessary.
My question is this: How do I prevent data from being written to our LIVE table via the Live.aspx page everytime a query string is processed by my indicator.ashx is accessed?
i have one user control which has hiddenField name ='hdnShow' as runat='server'
my scenario is that i have a function in userControl name Show(MessageType);
void Show(MessageType msg)
{
switch(msg)
{
case MessageType.Success:hdnShow.Value= "Success fully saved";
[Code]....
when i execute it and tries to get value of hiddenField thru javascript it still predicts the initial value.
Strange thing is that when i make a textbox in webusercontrol and then try to set its value thru this function.
even the textbox value don't change we can see it on aspx page that value is still the initial one.
some site has asserted that we can do that thru preRender event but it is not working.
may be it is happening coz it is in updatePanel??
yeah i have tried EnableViewstate true and false both condition.
How to add/import class library written in c# in to a web form (asp.net )
View 1 RepliesI've recently been given the task of diagnosing and fixing an internally written asp site that is used to transfer large files internally and externally.
The user uploads a file and enters the receivers email address. The receiver can then click on the link which takes them to the retrieval section of the site.
The issue is although we currently have an upload limit of 100MB set within the web.config file "maxRequestLength=102400", when a user uploads a file of more than 60MB although the upload works and the file is copied to the server when the receiver tries to access it the page simply displays "Internet Explorer cannot display this page".
The site works fine for files that are smaller than 60MB so I don't think it's a code issue, but I can't be 100% certain.
Is it possible to view the code written inside DateTime.IsLeapYear()[view the code inside IsLeapYear()]?
If yes then how can one see it?
I have written a piece of code which exports the gridview to an excel file. But this code created the grid on the firstrow,firstcolumn of spreadsheet.
How can i modify this code to write the grid on a given row& column?
[Code]....
I am working with a repeater control for a reporting purpose.
I have 2 repeaters one inside another , i hvae to bind the second repeater with the help of function which is having two parameters to pass in it
<asp:Repeater
ID="Rptgsaaccount"
runat ="server"
DataSource ='<%#bindcourse(Eval("Session_Id"),2nd parameter)%>'>
the first parameter is i am easily getting from outer repeater, but the second parameter value is exist on the server side and in a session variable
i have to pass this server side session variable value in above mentioned function as a second parameter .
On my content page I have the code (in page_load):
if (Master.pageAction == "remove")
{
int removeProductID = int.Parse(Request.QueryString["ID"]);
int removeOptionID = int.Parse(Request.QueryString["optID"]);
Master.myBasket.removeFromBasket(removeProductID, removeOptionID);
//Response.Redirect("viewBasket.aspx");
}
The function remove from basket is defined as:
// Removes item from a basket
public void removeFromBasket(int itemsID, int optionsID)
{
Page myPage = (Page)HttpContext.Current.Handler;
this.setCookieString("");
myPage.Response.Write("done");
}
And it calls:
// Sets cookie date
public void setCookieString(string cookiesData)
{
Page myPage = (Page)HttpContext.Current.Handler;
HttpCookie basketCookie = new HttpCookie("basket");
basketCookie["items"] = cookiesData;
basketCookie.Expires = DateTime.Now.AddDays(7d);
myPage.Response.Cookies.Add(basketCookie);
}
I use the setcookiestring function on other pages and it works fine, but this function (removing from the basket) isn't setting the cookie! It is writing "done" to the top of the page, so the functions are executing.
No warnings, no errors, it's just not updating the cookie.
I am trying to justify writing a website in asp.net that has the potential to be as large as wikipedia. Are there any large websites content driven websites that have been written asp.net?
View 1 RepliesI am trying to call a webservice, written in PHP from ASP.Net. I have added Web Reference using "Add Web Reference". The url is: http://mikikard.com/public/webservice?wsdl
In Add Web Reference Window, I can see the list of functions. But, When I try to build the Website, It gives the following Error:
Unable to import binding 'SoaptestBinding' from namespace 'http://mikikard.com/public/webservice'.
We have a site and a logged in section of the site that all was written in classic asp. We are starting to convert the site pages to asp.net 3.5. We are starting with the easiest pages (text mainly) first then we will rewrite the web application part of the site.
My question is - Is it possible to run the new asp.net 3.5 pages with classic asp pages? Or will we need to rewrite everything before deploying?
I am working on a tool which audits access to existing web application. Existing app does not have any hooks in place, but my plan is to inject an IHttpModule by modifying web.config and log whatever I need to log during EndRequest event.
What I'm struggling with right now is: I cannot intercept what is application writing to an output stream. I need to know what output does the application send to the client. Originally, I hoped I could run a code in BeginRequest to replace HttpContext.Response.OutputStream with a stream of my own, which would be flushed to original stream during EndRequest, but the stream only has a get accessor, so I cannot replace it.
I could of course use reflection to assign to private member of HttpContext.
public static DataTable GetDataTable(SqlCommand sqlCmd)
{
DataTable tblMyTable = new DataTable();
DataSet myDataSet = new DataSet();
try
{
//1. Create connection
mSqlConnection = new SqlConnection(mStrConnection);
//2. Open connection
mSqlConnection.Open();
mSqlCommand = new SqlCommand();
mSqlCommand = sqlCmd;
//3. Assign Connection
mSqlCommand.Connection = mSqlConnection;
//4. Create/Set DataAdapter
mSqlDataAdapter = new SqlDataAdapter();
mSqlDataAdapter.SelectCommand = mSqlCommand;
//5. Populate DataSet
mSqlDataAdapter.Fill(myDataSet, "DataSet");
tblMyTable = myDataSet.Tables[0];
}
catch (Exception ex)
{
}
finally
{
//6. Clear objects
if ((mSqlDataAdapter != null))
{
mSqlDataAdapter.Dispose();
}
if ((mSqlCommand != null))
{
mSqlCommand.Dispose();
}
if ((mSqlConnection != null))
{
mSqlConnection.Close();
mSqlConnection.Dispose();
}
}
//7. Return DataSet
return tblMyTable;
}
I use the above code to return records from database. The above snippet would run in web application which expected to have around 5000 visitors daily. The records returned reach 20,000 or
over. The returned records are viewed (read-only) in paged GridView.
Would it be better to use DataReader instead of DataTable?
NOTE: two columns in the GridView are hyperlinked.
are i can send trackback through script written in c#. show me the code or way that i can use them to sending a trackback
View 1 RepliesMy title says it all, I am looking to see if there is any built in class/function that basically takes a number and gives back the number in letters such as 10 to ten.
View 1 Replies