The theoretical question, in one view two partial are enclosed. If in one is registered id (for example id = name) whether id from other partial is visible?
- oneGentlemen, well, why immediately minus? The person had a question in connection with another question , trying to figure it out. - AK ♦
- oneWhen the html-page is formed and sent to the client browser there will be no information at all where any partial was, it will be one single page. Perhaps it makes sense for you to clarify what problem you are solving? Why do you need to know something from one partial about another (id, class, etc.)? - AK ♦
- @AK "When the html-page is formed and go to the client browser there will be no information at all where any partial were" - I could not find this information on the Internet. Please register as an answer and for it I will mark as correct. - Maksims
- I can and arrange, but you did not answer what you specifically want from your task with id'shniki. You can even register them clearly and rigidly, but you can only train yourself to hammer nails with a microscope and copy other people's code from the Internet. On mete there is a topic about the XY problem , read it - maybe you will understand that it is not for nothing that they are pulling out a task from you, and they do not give an answer to a specific question. - AK ♦
- @AK I need an id in order to press one checkbox to turn on two. I asked about it here. ru.stackoverflow.com/questions/702810/… - Maksims
1 answer
You do not have enough fundamental knowledge about the work of the client and server side.
All separation into partial partial only makes sense on the server side, you make logical blocks that you can combine for your convenience as you need. You can reuse the code, avoid copy-paste, etc.
But the server’s work, whether it is a page on php or asp.net, mvc ultimately boils down to the fact that sooner or later the final Html (a simple string) will be collected, which will go to the user's browser.
This page will have one big piece of code and no partial traces will be saved.
NB Provided that you display both Partial on the same web page . The clarification is strange, but it seems to be necessary , given the context in which this question is asked.