|
As far as I know this isnt possible with plain ASP.NET
|
|
|
|
|
roguemat wrote: As far as I know this isnt possible with plain ASP.NET
Why?
|
|
|
|
|
Member 3879881 wrote: suppose if i say the image dimension is 300*250...,
it have to accept that much only...,
cant accept 301*250 also...,
Here is an simple logic, Hope this will help you
int imgWidth=301;
int imgHeight=250;
if(ValidateImageDimension(FileUpload.PostedFile.InputStream, 301, 250));
{
}
else
{
}
Here is the generic function
public bool ValidateImageDimension(Stream imgstream, int imgWidth, int imgHeight)
{
System.Drawing.Image img = System.Drawing.Image.FromStream(imgstream);
if (img.Width <= imgWidth && img.Height <= imgHeight)
return true;
else
return false;
}
Hope this will help you.
|
|
|
|
|
Wow, wish I had know this, I needed it a while back and asked around and the couple of people I spoke to said its impossible to do anything with the file until it has been uploaded...
Shot
|
|
|
|
|
Hello,
There are 43 textboxes on the web page of my database driven web application. Generally, what we do: (ds means dataset object)
ds.Tables(0).Rows(r - 1).Item(0)=Textbox1.text
ds.Tables(0).Rows(r - 1).Item(1)=Textbox2.text
... or something like it.
Now suppose, if user changed the values of textbox 17,23 and/or 5,8,31; then update should be only for those column; to avoid unnecessary I/O and faster update. Is there any mean/method in ASP.NET by which we can control only limited update in table.
Please guide,help and teach me.
Best Regards
Girish Sharma
|
|
|
|
|
Do the text boxes have autopostback set to true?
There is no foolish question, there is no final answer...
|
|
|
|
|
No, because i think it will unnecessary increase network traffic and more request to server though.
|
|
|
|
|
Ok that's fine. In the button click event, just check whether the text box's value equals to the datatable rows' value or not. if it is not then only update the column else don't. Just checkout the sample code:
if(dataSet.Tables[0].Rows[8][column_name] != textBox8.Text)
{
dataSet.Tables[0].Rows[8][column_name] = textBox8.Text
}
So the datatable will be updated only when the value differs from the earlier one and that means that the text box's value is changed.
Is it clear? Revert back for any clarification.
There is no foolish question, there is no final answer...
|
|
|
|
|
Thanks for your reply; but at the last for saving the new values in the database; i will have to call adapter.update(ds); it means it will fire the complete update command. And moreover i am using following code to create dataset:
Dim ods As New DataSet
ods.ReadXml("C:\Inetpub\wwwroot\Exam2\Temp.xml")
So,
1.will it work on the dataset and update the table ?
2.and i will have to call adapter.update(ods); means a complete update command ?
What i am seeking, that after changing the values in textboxes; only those columns should be updated; rather than a complete row.
Regards
Girish Sharma
|
|
|
|
|
The you can probably look a for writing a sql query for updating fields. You can run a for loop to check the values and after that fire the sql query only for those columns whose values are changed. DataAdapter.Update may not be a best case in this scenario.
There is no foolish question, there is no final answer...
|
|
|
|
|
Here one idea/approach may be using javascript. A javascript function, which will be called on textbox change event (if value changed then) with create and append a update command and then fire that update command on cliking the update button; but i do'nt have knowledge in js; just have the idea how it may worked.
|
|
|
|
|
You will not be able to access the value which is set in javascript because on the server side those values will be lost.
There is no foolish question, there is no final answer...
|
|
|
|
|
Then please tell me the best and easy method to get update command for selected (changed values) columns.
Kind Regards
Girish Sharma
|
|
|
|
|
Then please provide me the solution by which i can get one update command for only those columns whose textbox values has been changed by user.
Kind Regards
Girish Sharma
|
|
|
|
|
|
But further you are agreeed that adapter.update is not best in this scnerio; so still waiting for your reply please.
|
|
|
|
|
I am not telling you to use DataAdapter.Update. Run a for loop and check if the textbox's value differs from the datatable's (dataset.tables[0]) value or not. if it differs then create a sqlconnection object and associate it to a sqlcommand object. Then fire a sql update query by using sqlcommand.executenonquery method. by this way, you will fire sql update for only those rows whose values are changed in the textboxes.
There is no foolish question, there is no final answer...
|
|
|
|
|
my code is like tis
tis code works on the same page only i want to set the language setting in all pages.....
Imports System
Imports System.Globalization
Imports System.Threading
Imports System.Resources
Imports System.Reflection.AssemblyName
Imports System.IO
Partial Class Testmultiligual
Inherits System.Web.UI.Page
Private rm As ResourceManager
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con.ConnectionString = ConfigurationManager.ConnectionStrings("ESCConnection").ConnectionString
Dim ci As CultureInfo
If Not Page.IsPostBack Then
gridbind()
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"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
Else
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
End Sub
Private Sub LoadStrings(ByVal ci As CultureInfo)
HylEdit.Text = rm.GetString("Add", ci)
BtnClear.Text = rm.GetString("Clear", ci)
BtnSave.Text = rm.GetString("Save", ci)
HylView.Text = rm.GetString("View", ci)
TDAwd.InnerText = rm.GetString("Awd", ci)
TDAwdDes.InnerText = rm.GetString("Awddes", ci)
TDAwdpic.InnerText = rm.GetString("Awdpi", ci)
TDFreq.InnerText = rm.GetString("Freq", ci)
TDAwdcri.InnerText = rm.GetString("Awdcri", ci)
TDAwdSt.InnerText = rm.GetString("AwdSt", ci)
TDAwdk.InnerText = rm.GetString("Awdk", ci)
'TDGrvTitle.InnerText = rm.GetString("GrvTitle", ci)
GVawdview.Columns(1).HeaderText = rm.GetString("AwdNam", ci)
GVawdview.Columns(2).HeaderText = rm.GetString("Awdesc", ci)
GVawdview.Columns(3).HeaderText = rm.GetString("Frequcy", ci)
GVawdview.Columns(4).HeaderText = rm.GetString("Active", ci)
End Sub
Protected Sub lnkEng2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEng2.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
Protected Sub LnkEng1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LnkEng1.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
|
|
|
|
|
Was it required to create a new thread to post the same question?
There is no foolish question, there is no final answer...
|
|
|
|
|
Please don't Cross Post. Read the forum guide line before post any new question.
|
|
|
|
|
Hi all,
I want to user google custom local search in my website.
I dont want to user google serch control for local search.
I want to use my own control in website for that purpose google
provided a search form function and i can't understand how can i
use this. Please help me to solve the problem?
Thanks
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Your intention is not clear to me. Do you want to implement search functionality like Google but it search items which only reside in your web site? Or do you want to use Google API to incorporate Google Search functioanlity in your web application?
There is no foolish question, there is no final answer...
|
|
|
|
|
I want to incorporate Google custom local Search functioanlity in my website.
check the url maps.google.com and enter any location eg newyork,pune.
you will get some location which contain newyork text in pune city.
I want to use these api in my website but instead of using google search control
i want to use my own control. Using custom form property o API we can create our own
control.I am trying to implement that one.
check this
http://code.google.com/apis/ajaxsearch/documentation/reference.html[^]
hope you will understand.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
my code is like tis
tis code works on the same page only i want to set the language setting in all pages.....
Imports System
Imports System.Globalization
Imports System.Threading
Imports System.Resources
Imports System.Reflection.AssemblyName
Imports System.IO
Partial Class Testmultiligual
Inherits System.Web.UI.Page
Private rm As ResourceManager
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con.ConnectionString = ConfigurationManager.ConnectionStrings("ESCConnection").ConnectionString
Dim ci As CultureInfo
If Not Page.IsPostBack Then
gridbind()
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"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
Else
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
End Sub
Private Sub LoadStrings(ByVal ci As CultureInfo)
HylEdit.Text = rm.GetString("Add", ci)
BtnClear.Text = rm.GetString("Clear", ci)
BtnSave.Text = rm.GetString("Save", ci)
HylView.Text = rm.GetString("View", ci)
TDAwd.InnerText = rm.GetString("Awd", ci)
TDAwdDes.InnerText = rm.GetString("Awddes", ci)
TDAwdpic.InnerText = rm.GetString("Awdpi", ci)
TDFreq.InnerText = rm.GetString("Freq", ci)
TDAwdcri.InnerText = rm.GetString("Awdcri", ci)
TDAwdSt.InnerText = rm.GetString("AwdSt", ci)
TDAwdk.InnerText = rm.GetString("Awdk", ci)
'TDGrvTitle.InnerText = rm.GetString("GrvTitle", ci)
GVawdview.Columns(1).HeaderText = rm.GetString("AwdNam", ci)
GVawdview.Columns(2).HeaderText = rm.GetString("Awdesc", ci)
GVawdview.Columns(3).HeaderText = rm.GetString("Frequcy", ci)
GVawdview.Columns(4).HeaderText = rm.GetString("Active", ci)
End Sub
Protected Sub lnkEng2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEng2.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
Protected Sub LnkEng1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LnkEng1.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
|
|
|
|
|
dear all,
i have to maintain the viewstate of page when i m pressing the moveback button,
how do i do that?
Regards
|
|
|
|