|
ankurdsharma wrote: objDT = New System.Data.DataTable("Cart")
ankurdsharma wrote: objDT = Session("Cart")
Did you check the Session variable for null ?
Where is the Type Cast ?
ankurdsharma wrote: objDR = objDT.NewRow(GETTING ERROR IN THIS LINE)
'Error is same which is written in Subject line
So that the reason that you are getting error here.
|
|
|
|
|
How to Add the BindingManager to the tool box in asp.net
modified on Friday, June 12, 2009 7:21 AM
|
|
|
|
|
Hi Everybody
I need to fetch most visited articles from my News module...Please give me some idea
Thanks in advance
Ramkumar
|
|
|
|
|
What have you tried ? What seems the obvious way to do that ? Do you store a counter for how often a page is visited ? If not, how do you expect to do this ? If so, it suddenly becomes trivial, right ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
How are you going to track that totally depends on your strategy and business requirement? But stating from the basic, you can probably create a column called "viewcount" on any of the table where you are storing all articles. In the page load and under if(!IsPostBack) just write down the code to update the "viewcount" flag by 1. Just a basic idea which may help you.
Regards
Saanj
There is no foolish question, there is no final answer...
|
|
|
|
|
You could always use something like Google Analytics - It takes a few minutes to set up as it just requires that you add some javascript to your page.
Alternatively, you probably want to create a database table and each time you have to render a news article INSERT a row in the database to say what article was rendered and any other information you want to store with that (e.g. a date/time, the UrlReferrer, etc. etc.)
To get the most visited articles all you need to do is count each time an article appears in the database.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Hi all,
I want to redirect the page after alert box is clicked . but the page redirects before the alert was called Wat to do..
|
|
|
|
|
can you paste the code that is redirecting the page and displaying alert
|
|
|
|
|
You should use javascript,fire function name from your control.
function ShowAlert()
{
alert('You will redirect in another page');
window.open(' yoururladdress/pagename.aspx');
}
onclick="ShowAlert()"
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
This is wat i used but the page is redirected without waiting for alert box.
|
|
|
|
|
Which control you are using to redirect in another page?
If you are using button then use property
OnClientClick="ShowAlert(); return false;"
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I have validation one the control.Now validation is not working..
|
|
|
|
|
Your core problem is that you think we're mind readers. Your code is broken. We can't fix it without seeing it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
This is the code at client side
function changed() {
alert('Password changed successfully');
window.open("UserProfile.aspx");
return false;
}
I called it at the server side as
Page.RegisterStartupScript("Error", "<script>changed()</script>");
Response.Redirect("UserProfile.aspx");
inside the click event of the button.That button will cause validation also.
My problem is the page is redirected before alert is clicked.
|
|
|
|
|
According to me, the code should redirect to Default.aspx not UserProfile.aspx.
In server side code, you register the client script block and then you redirected it to Default.aspx. You comment the Response.Redirect, it will start redirecting to UserProfile Page
|
|
|
|
|
Yes, that's always going to be the case - why don't you put your redirection into the javascript function as well...
|
|
|
|
|
anu_anu wrote: Page.RegisterStartupScript("Error", "changed()");
This injects script into the page.
anu_anu wrote: Response.Redirect("UserProfile.aspx");
This redirects, so that your page is never rendered.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Post the code which you are using. Code shared by Blue Boy should definitely work.
There is no foolish question, there is no final answer...
|
|
|
|
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ci As CultureInfo
If Not Page.IsPostBack Then
'Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))--------------> error here
"Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified."
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
End Sub
|
|
|
|
|
What makes you think that an assembly of that name exists ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
When I retrieve an image from sql database in the grid view I had the following (System.Byte[]) instead the image. What is the problem?
Thank you
|
|
|
|
|
You are not displaying images correctly.
Check this link[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
y_mmohd wrote: When I retrieve an image from sql database in the grid view I had the following (System.Byte[]) instead the image.
Where are you getting the error? Is there any thing problem with byte conversion ?
Have a look into this article, This is another way to show image from database to gridview. Displaying Image in Gridview from Database
Here you have to store image path in the database rather than the image. Image will store in your hard drive.
|
|
|
|